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
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;