From 6ad91180b2bd69a6ad70cde78702d36e9c862dd8 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 23 Oct 2010 07:43:17 -0600 Subject: [PATCH] Author: Alex Rousskov 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/http.cc b/src/http.cc index 2c03b28834..6ae54d2d6a 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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)) -- 2.47.2