]> git.ipfire.org Git - thirdparty/squid.git/commit
Treat responses to collapsed requests as fresh (#1927)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 27 Nov 2024 02:32:02 +0000 (02:32 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 27 Nov 2024 02:54:06 +0000 (02:54 +0000)
commitee9899320abfe596fdb6f5589a9fce5814d3a455
tree24ed1ce63caf2c90ab4f9dc920cc678ade62af3f
parent6bd74111a80de08270dc5886e6ad6bcd7d5e08b4
Treat responses to collapsed requests as fresh (#1927)

Squid transactions involving collapsed requests receive their responses
as Store cache hits. Cache hits undergo mandatory freshness validation
checks and, if those checks detect a stale response, may trigger
revalidation (e.g., an If-Modified-Since request to the origin server).
This logic results in a still-being-delivered-to-Squid response
triggering its own revalidation if that response is deemed stale on
arrival by collapsed request (e.g., has a Cache-Control: max-age=0
header field).

HTTP RFC 9111 Section 4.7 briefly mentions collapsed requests but is
ambiguous with regard to validation of responses to collapsed requests.
IETF HTTP Working Group chair believes that specs are unclear, and that
these responses should not be treated as cache hits (in primary cases):
https://lists.w3.org/Archives/Public/ietf-http-wg/2024JanMar/0095.html

This change follows the above advice and prevents arguably excessive
freshness checks for responses to collapsed requests. This change is
collapsed-forwarding specific: It does not prevent freshness checks for
responses that were, at the time of a hit request, either fully cached
or still receiving response body bytes.

After this change, clientReplyContext can no longer collapse twice, once
after initial Store lookup and then again during refresh, because the
first collapse now precludes refresh.
doc/release-notes/release-7.sgml.in
src/StoreClient.h
src/cf.data.pre
src/client_side_reply.cc
src/htcp.cc
src/icp_v2.cc
src/refresh.cc
src/store_client.cc
src/store_digest.cc
src/urn.cc
test-suite/test-functionality.sh