Re: i37: Vary and non-existant headers

Julian Reschke wrote:
> How about:
> 
> "When a cache receives a request that can be satisfied by a stored 
> response that includes a Vary header field (Section 3.5), it MUST NOT 
> use that response unless all of the selecting request-headers stored 
> from the original request match those in the presented request."
> 
> ?

No, because it is wrong.  Example:

   Stored original request does not have Accept-Encoding.
   Stored response has "Vary: Accept-Encoding".

   New request has "Accept-Encoding: gzip"
        => Cache MUST NOT use the stored response.

   New request has "Accept-Encoding: deflate"
        => Cache MUST NOT use the stored response.

   New request has "Accept-Encoding:"
        => Cache MUST NOT use the stored response.
 
   New request does not have Accept-Encoding.
        => Cache MAY use the stored response.

The original request's _lack_ of Accept-Encoding header is being
varied on.

The proposed text doesn't make this any clearer than the existing
text, it just moves the ambiguity from missing headers in the new
request to missing headers in the original request.

For each header mentioned in Vary, the value or absence of that header
must be the same for the original and new requests.

Here is proposed replacement:

   "When a cache receives a request that can be satisfied by a stored
   response that includes a Vary header field (Section 3.5), it MUST
   NOT use that response unless, for every header identified by the
   stored Vary, the header's value or absence in the original request
   matches its value or absence in the presented request."

(When the stored Vary is "*", _any_ more or fewer headers (except
transport headers?) in the presented request must prevent a match).

-- Jamie

Received on Thursday, 7 May 2009 15:51:54 UTC