Niklas Edmundsson wrote:

The solution is to NOT rewrite the on-disk headers when the following conditions are true:
- The body is NOT stale (ie. HTTP_NOT_MODIFIED when revalidating)
- The on-disk header hasn't expired.
- The request has max-age=0

This is perfectly OK with RFC2616 10.3.5 and does NOT break anything.

From 10.3.5: "If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response." This sinks this, unless I am misunderstanding something.

I suspect there is a more robust way of solving this:

In order to determine whether the entity was cached in the first place, the cache would have had to read the headers in from disk.

Fast forward to after the 304 response was received, we have the headers as received from the backend.

Compare these two sets of headers, and if they are equal, there is no need to rewrite them to disk.

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to