]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 13:43:17 +0000 (07:43 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 13:43:17 +0000 (07:43 -0600)
HTTP Compliance: do not cache replies to requests with CC/no-store.

Per RFC 2616, do not store any part of response to requests with a no-store
Cache-Control directive.

We may still _serve_ no-store requests from the cache because RFC 2616 does not
seem to prohibit that. This may change if HTTPbis or developers decide to
prohibit no-store hits.

Co-Advisor test case:
    test_case/rfc2616/ccReqDirMsg-no-store-basic

src/http.cc

index 2c03b2883435ca2f8cd414985c75f73b07838013..6ae54d2d6a792d15f9217f6fa1a20844935bf1cb 100644 (file)
@@ -372,6 +372,12 @@ HttpStateData::cacheableReply()
     if (surrogateNoStore)
         return 0;
 
+    // RFC 2616: do not cache replies to responses with no-store CC directive
+    if (request && request->cache_control &&
+        EBIT_TEST(request->cache_control->mask, CC_NO_STORE) &&
+        !REFRESH_OVERRIDE(ignore_no_store))
+        return 0;
+
     if (!ignoreCacheControl) {
         if (EBIT_TEST(cc_mask, CC_PRIVATE)) {
             if (!REFRESH_OVERRIDE(ignore_private))