This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 5af03d6feb67edb14e626d9df2ab8cfcfca9fc54
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Thu May 6 00:05:45 2021 +0900

    Make when_to_revalidate setting available on HTTPS (#7753)
    
    A setting to specify when to revalidate cache 
(proxy.config.http.cache.when_to_revalidate) was only available for cleartext 
HTTP.
    
    (cherry picked from commit 40b5da1dcd3b1f5c0b6925817a7e34ce66fa3f93)
---
 proxy/http/HttpTransact.cc | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 1c0076a..f548530 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7261,17 +7261,13 @@ HttpTransact::what_is_document_freshness(State *s, 
HTTPHdr *client_request, HTTP
 
   TxnDebug("http_match", "[what_is_document_freshness] fresh_limit:  %d  
current_age: %" PRId64, fresh_limit, (int64_t)current_age);
 
-  /////////////////////////////////////////////////////////
-  // did the admin override the expiration calculations? //
-  // (used only for http).                               //
-  /////////////////////////////////////////////////////////
   ink_assert(client_request == &s->hdr_info.client_request);
 
-  if (s->txn_conf->cache_when_to_revalidate == 0) {
-    ;
-    // Compute how fresh below
-  } else if (client_request->url_get()->scheme_get_wksidx() == 
URL_WKSIDX_HTTP) {
+  if (auto scheme = client_request->url_get()->scheme_get_wksidx(); scheme == 
URL_WKSIDX_HTTP || scheme == URL_WKSIDX_HTTPS) {
     switch (s->txn_conf->cache_when_to_revalidate) {
+    case 0: // Use cache directives or heuristic (the default value)
+      // Nothing to do here
+      break;
     case 1: // Stale if heuristic
       if (heuristic) {
         TxnDebug("http_match", "[what_is_document_freshness] config requires 
FRESHNESS_STALE because heuristic calculation");

Reply via email to