trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [2/2] git commit: TS-2342 Problem with cache.cache_responses_to_cookies value 0.
Date Fri, 16 May 2014 22:11:19 GMT
TS-2342 Problem with cache.cache_responses_to_cookies value 0.

Nice catch Paul!


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

Branch: refs/heads/master
Commit: 5f5ae1b5f1f4b51ead2bc966adfd636d3a97d0cb
Parents: 727811e
Author: Paul Marquess <Paul.Marquess@owmobility.com>
Authored: Fri May 16 15:36:57 2014 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Fri May 16 16:10:29 2014 -0600

----------------------------------------------------------------------
 CHANGES                    |  3 +++
 proxy/http/HttpTransact.cc | 11 +++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5f5ae1b5/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f772da3..aa96ccc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2342] Problem with cache.cache_responses_to_cookies value 0.
+   Author: Paul Marquess <Paul.Marquess@owmobility.com>
+
   *) [TS-2751] Remove the ProtocolNetAccept layer.
 
   *) [TS-2815] SSL orgin server connection hangs if ssl handshake is slow

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5f5ae1b5/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index c646869..732ed4d 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -402,10 +402,7 @@ do_cookies_prevent_caching(int cookies_conf, HTTPHdr* request, HTTPHdr*
response
   if ((CookiesConfig) cookies_conf == COOKIES_CACHE_ALL) {
     return false;
   }
-  // Do not cache if cookies option is COOKIES_CACHE_NONE
-  if ((CookiesConfig) cookies_conf == COOKIES_CACHE_NONE) {
-    return true;
-  }
+
   // It is considered that Set-Cookie headers can be safely ignored
   // for non text content types if Cache-Control private is not set.
   // This enables a bigger hit rate, which currently outweighs the risk of
@@ -423,6 +420,12 @@ do_cookies_prevent_caching(int cookies_conf, HTTPHdr* request, HTTPHdr*
response
                                                    || !cached_request->presence(MIME_PRESENCE_COOKIE)))
{
     return false;
   }
+
+  // Do not cache if cookies option is COOKIES_CACHE_NONE
+  // and a Cookie is detected
+  if ((CookiesConfig) cookies_conf == COOKIES_CACHE_NONE) {
+    return true;
+  }
   // All other options depend on the Content-Type
   content_type = response->value_get(MIME_FIELD_CONTENT_TYPE, MIME_LEN_CONTENT_TYPE, &str_len);
 


Mime
View raw message