Collapsed requests and response freshness checks

Hello,

     RFC 9111 Section 4[1] says "cache can use a response that is stored 
or storable to satisfy multiple requests, provided that it is allowed to 
reuse that response for the requests in question". I am trying to 
understand which rules allow or prohibit that reuse. My guess is that 
_all_ "MUST not reuse a stored response unless..." rules in that Section 
apply, but since the response to the collapsed request is not 
necessarily a "stored response" (i.e. it could be "storable"), I want to 
double check.

For example, can a cache reuse a stale-on-arrival response to satisfy a 
collapsed request (without doing revalidation)? Let's assume the 
response in question is not "allowed to be served stale". Informally, 
the response in question is nearly as fresh as they get because it is 
being received to satisfy a _concurrent_ request (that our request has 
collapsed on). However, formal freshness rules may still require 
treating this response as stale (e.g., max-age=0), either in general 
(i.e. for any request) or with respect to our collapsed request.

Similarly, can a cache reuse a stale-on-arrival response with a 
must-revalidate directive to satisfy a collapsed request (without doing 
revalidation)? Here, the wiggle room for reuse appears to be even 
smaller because a cache "MUST NOT reuse that response to satisfy another 
request until it has been successfully validated by the origin".

I suspect the answers are "no" and "no", and, more generally speaking, 
there are just no reuse exceptions for collapsed requests compared to 
regular cache hits -- a cache has to treat the incoming response as if 
it was a previously stored cache hit, even though the response may still 
be coming into the cache (as the result of the original request that our 
request has collapsed on). In other words, all Section 4 reuse rules[1] 
apply. I would appreciate a confirmation.


Thank you,

Alex.

[1]: 
https://www.rfc-editor.org/rfc/rfc9111.html#name-constructing-responses-from

Received on Saturday, 17 February 2024 22:02:50 UTC