httpwg / http-extensions

HTTP Extensions in progress
https://httpwg.org/http-extensions/
447 stars 146 forks source link

no-vary-search: Allow more efficient caches by assuming consistency #2930

Closed jeremyroman closed 3 weeks ago

jeremyroman commented 4 weeks ago

For most known use cases, a particular resource is consistently invariant to the same query parameters (i.e., either only certain parameters are ever meaningful, or certain parameters are always meaningless).

In such cases, it is possible to avoid searching several stored responses and take a more efficient approach. This shortcut might be desirable in, for example, browser disk cache implementations, where the number of accesses is known to affect cache latency significantly.

Implementations are not required (neither servers nor caches) to take this shortcut; the worst consequence is an avoidable cache miss. Incorrect stored responses are never used.

Resolves #2908.

jeremyroman commented 4 weeks ago

This isn't quite as natural to fit in while the rest of the integration with RFC9111 isn't really present and other cache applications are specified elsewhere (e.g., nav prefetch), but I still think it's worth putting in declaratory normative statements to reflect discussion on this issue.

@domenic PTAL @valenting This pretty closely reflects what we discussed on the linked issue, I think, but please chime in if you think something's been lost along the way or otherwise needs revision.