You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by wb...@apache.org on 2015/03/12 18:20:43 UTC

trafficserver git commit: TS-3331 negative responses cached even when headers indicate otherwise

Repository: trafficserver
Updated Branches:
  refs/heads/master b416a1dfa -> e5f2bb554


TS-3331 negative responses cached even when headers indicate otherwise

Slim down fix based on feedback from Sudheer Vinukonda


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e5f2bb55
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e5f2bb55
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e5f2bb55

Branch: refs/heads/master
Commit: e5f2bb554eb33e9b29cf728d2bcb04ba4f1b0e8a
Parents: b416a1d
Author: William Bardwell <wb...@apache.org>
Authored: Thu Mar 12 13:02:54 2015 -0400
Committer: William Bardwell <wb...@apache.org>
Committed: Thu Mar 12 13:18:33 2015 -0400

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5f2bb55/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 2f585e7..0078ef1 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -198,10 +198,7 @@ is_negative_caching_appropriate(HttpTransact::State* s)
   case HTTP_STATUS_BAD_GATEWAY:
   case HTTP_STATUS_SERVICE_UNAVAILABLE:
   case HTTP_STATUS_GATEWAY_TIMEOUT:
-    return ((response_cacheable_indicated_by_cc(&s->hdr_info.server_response) >= 0) &&
-            (HttpTransactHeaders::does_server_allow_response_to_be_stored(&s->hdr_info.server_response) ||
-                s->cache_control.ignore_server_no_cache ||
-                (s->cache_control.ttl_in_cache > 0)));
+    return true;
   default:
     break;
   }
@@ -4263,7 +4260,7 @@ HttpTransact::handle_cache_operation_on_forward_server_response(State* s)
     client_response_code = server_response_code;
     base_response = &s->hdr_info.server_response;
 
-    s->negative_caching = is_negative_caching_appropriate(s);
+    s->negative_caching = is_negative_caching_appropriate(s) && cacheable;
 
     // determine the correct cache action given the original cache action,
     // cacheability of server response, and request method