]> git.ipfire.org Git - thirdparty/squid.git/commit
Replaced X-Cache and X-Cache-Lookup headers with Cache-Status (#705)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 28 Aug 2020 18:47:04 +0000 (18:47 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 28 Aug 2020 20:37:07 +0000 (20:37 +0000)
commit5fdc549054b11eb8bbc7e9640d6d071fa1ef742b
tree1e933bba406a939cac874efa99cc016ffaa34832
parent76b18386173b7486387f6c3231c8938dc7bf3fa5
Replaced X-Cache and X-Cache-Lookup headers with Cache-Status (#705)

See https://tools.ietf.org/html/draft-ietf-httpbis-cache-header

Also switched to identifying Squid instance in the header using
unique_hostname(), fixing a bug affecting proxies that share the same
visible_hostname in a cluster. The Cache-Status field values will now
point to a specific proxy in such a cluster.

The new initial lookup reporting (formally X-Cache-Lookup)
implementation has several differences:

* The reporting of the lookup is now unconditional, just like the
  Cache-Status reporting itself. The dropped X-Cache-Lookup required
  --enable-cache-digests. We removed that precondition because
  Cache-Status already relays quite a bit of information, and sharing
  lookup details is unlikely to tilt the balance in most environments.
  The original lookup reporting code was conditional because the feature
  was added for Cache Digests debugging, not because we wanted to hide
  the info. Folks later discovered that the info is useful in many other
  cases. If we do want to hide this information, it should be done
  directly rather than via a (no) Cache Digests side effect.

* The initial lookup classification can no longer be overwritten by
  additional Store lookups. Official code allowed such rewrites due to
  implementation bugs. If we only report one lookup, the first lookup
  classification is the most valuable one and almost eliminates doubts
  about the the cache state at the request time. Ideally, we should also
  exclude various internal Store lookup checks that may hide a matching
  cache entry, but that exclusion is difficult to implement with the
  current needlessly asynchronous create() Store API.

* Lookup reporting now covers more use cases. The official code probably
  missed or mishandled various PURGE/DELETE use cases and did not
  distinguish absence of Store lookup because of CC:no-cache from other
  lookup bypass cases (e.g., errors). More work is probably needed to
  cover every lookup-avoiding case.
src/LogTags.cc
src/LogTags.h
src/client_side_reply.cc
src/client_side_reply.h
src/http/RegisteredHeaders.h
src/http/RegisteredHeadersHash.cci
src/http/RegisteredHeadersHash.gperf