Cache varying on particular cookies

Hello HTTPWG:

I'm working on speculative loading in Google Chrome (most saliently,
prefetch of documents for navigation) and looking at ways to address the
potential problem of prefetched resources becoming "stale" by the time they
are used due to the user logging in or out (or similar state changes), in
response to developer feedback. Workarounds are possible but somewhat
awkward <https://calendar.perfplanet.com/2023/rli/>.

Fundamentally it seems like something less strict than "Vary: Cookie" is
called for, which would let the client know which cookie values, if
changed, invalidate the cached resource. The semantics of this seem
potentially useful for other kinds of cache (e.g., some caching proxies can
be configured to work this way), so HTTP WG seems like potentially the
right venue to discuss this.

Mark Nottingham's Cookie-Indices proposal
<https://mnot.github.io/I-D/draft-nottingham-http-availability-hints.html#name-cookie>
(part
of HTTP Availability Hints) seems likely to address the problem and ought
to be implementable (I'm prototyping it in Chromium's prefetch cache, at
least), so that's what I'm looking at right now, but at this moment we're
not yet committed to a particular solution.

What do you all think?

Received on Wednesday, 21 February 2024 02:08:47 UTC