]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
HTTP Compliance: do not cache replies to requests with CC/no-store.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:44:32 +0000 (09:44 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:44:32 +0000 (09:44 -0600)
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 772f92cf099478b252508da5bf22b15b5b0d9bd1..ae25e7eb654f938d4514e826f961484c5721bf5d 100644 (file)
@@ -371,6 +371,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))