Bug #1548: Cleanup of 304 processing
by Doug Dixon <doug.dixon@gmail.com>
The main change is to the logging codes. Since all refreshes hit the origin, it
does not make any sense to refer to them as HIT or MISS. Instead, they have
been renamed to describe the result from the origin server:
* TCP_REFRESH_UNMODIFIED - The requested object was cached but STALE. The IMS
query for the object resulted in "304 not modified".
* TCP_REFRESH_FAIL - The requested object was cached but STALE. The IMS query
failed and the stale object was delivered.
* TCP_REFRESH_MODIFIED - The requested object was cached but STALE. The IMS
query returned the new content.
These actually fit the FAQ now (if you change the names):
http://www.squid-cache.org/Doc/FAQ/FAQ-6.html#ss6.7
Apart from that:
1. I've corrected the set of headers that should NOT be updated in an existing
cache entry on receipt of a 304 from the origin (i.e. hop-by-hop headers)
2. I've removed a couple more functions and put the code inline. It's easier to
follow.
only allowing the entity-headers specified as being cool for 304
(section 10.3.5) to update an entry:
Content-Location
Expires
All the other entity-headers are either a SHOULD NOT or MUST NOT for including
with a 304 anyway, so always ignore these when updating an entry: