From: Alex Rousskov Date: Mon, 4 Oct 2010 15:44:32 +0000 (-0600) Subject: HTTP Compliance: do not cache replies to requests with CC/no-store. X-Git-Tag: take1~204 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8466a4afe51f4cdd872388ab44217a120a5f5217;p=thirdparty%2Fsquid.git 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 --- diff --git a/src/http.cc b/src/http.cc index 772f92cf09..ae25e7eb65 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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))