From: Alex Rousskov Date: Tue, 2 Nov 2010 21:58:24 +0000 (-0600) Subject: HTTP Compliance: entry is stale if request has max-age=0. X-Git-Tag: take1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0a612703f5dbea67a75781216a68f909f9ff329;p=thirdparty%2Fsquid.git HTTP Compliance: entry is stale if request has max-age=0. We should always do validation for requests with Cache-Control max-age=0, even when entry age is also zero. In our case, RFC 2616 says: freshness_lifetime = max_age_value response_is_fresh = (freshness_lifetime > current_age) and response_is_fresh is always false if freshness_lifetime is zero. The check code was introduced in r5998 with a "Import of fix-ranges branch" message. The code was commented out at the time of that commit, for reasons unknown. Test case: test_case/rfc2616/noSrv-hit-stale-max-age-req --- diff --git a/src/refresh.cc b/src/refresh.cc index e4257f812d..b8030d335e 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -329,14 +329,11 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta) if (R->flags.ignore_reload && cc->max_age == 0) {} else #endif { -#if 0 - if (cc->max_age == 0) { debugs(22, 3, "refreshCheck: YES: client-max-age = 0"); return STALE_EXCEEDS_REQUEST_MAX_AGE_VALUE; } -#endif if (age > cc->max_age) { debugs(22, 3, "refreshCheck: YES: age > client-max-age"); return STALE_EXCEEDS_REQUEST_MAX_AGE_VALUE;