On 10/04/2010 07:33 PM, Amos Jeffries wrote:
On Mon, 04 Oct 2010 17:06:28 -0600, Alex Rousskov
<[email protected]>  wrote:
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)

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

+1 on the patch.

Committed to trunk as r11012.

In other related bits;
  I think we have a documentation bug with ignore-reload. That violations
if() case above it silently tests and skips for ignore-reload&&  max-age=0.
  Could you please add a debugs() message to the if() case matching the
other trace cases?

Done as r11013.

The test itself looks wrong to me, I would expect max-age=* all equate to
a client reload request when the object is outside that age. In these cases
it's unclear if a reload should be allowed despite the admin preference (as
now done). Or if the client should receive a fail or stale response.
  My leaning is that the client should get the stale response. The admin
has explicitly required a violation of HTTP and chosen to face the
consequences.

Squid.conf documentation says that ignore-reload ignores a client no-cache or "reload" header. It does not say anything about ignoring minimum freshness requirements. Zero max-age is a special case because it should only be used for reload and not for minimum freshness control. In a sense, max-age=0 as defined by RFC 2616 is not about the cached response age at all. Thus, the current code, while confusing, appears to match the documented intent.

In 3.1+ reverse-proxies the http_port "ignore-cc" option
should be used instead.

Ignore-cc will indeed bypass all max-age checks, regardless of the max-age value.

Thank you,

Alex.

Reply via email to