From: Amos Jeffries Date: Mon, 20 Dec 2010 04:53:23 +0000 (-0700) Subject: Author: Alex Rousskov X-Git-Tag: SQUID_3_1_10~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5272dc8e98b2bbae60366928d6050081671bf12;p=thirdparty%2Fsquid.git Author: Alex Rousskov 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 a61e5d820d..e3d0dbbdd6 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;