standards-positions icon indicating copy to clipboard operation
standards-positions copied to clipboard

No-Vary-Search

Open liviutinta opened this issue 3 years ago • 3 comments

Request for position on an emerging web specification

  • WebKittens who can provide input: @annevk

Information about the spec

  • Spec Title: No-Vary-Search
  • Spec URL: https://wicg.github.io/nav-speculation/no-vary-search.html
  • GitHub repository: https://github.com/WICG/nav-speculation
  • Explainer (if not README.md in the repository): https://github.com/WICG/nav-speculation/blob/main/no-vary-search.md

Design reviews and vendor positions

  • TAG Design Review: https://github.com/w3ctag/design-reviews/issues/797
  • Mozilla standards-positions issue: https://github.com/mozilla/standards-positions/issues/717

Anything else we need to know

No-Vary-Search is a proposed HTTP header which changes how various URL-keyed caches match, by letting them ignore some or all query parameters, or query parameter order. For example, if the order of the query parameter keys should not cause cache misses, this is indicated using

No-Vary-Search: key-order

If the specific query parameters (e.g., ones indicating something for analytics) should not cause cache misses, this is indicated using

No-Vary-Search: params=("utm_source" "utm_medium" "utm_campaign")

And if the page instead wants to take an allowlist-based approach, where only certain known query parameters should cause cache misses, they can use

No-Vary-Search: params, except=("productId")

liviutinta avatar Dec 08 '22 22:12 liviutinta

One thing that came up when discussing this with the HTTP community is that browsers currently ignore Vary in a bunch of caches and also have a poor implementation of it in the HTTP cache. As we go beyond Vary I think it makes sense to revisit that a bit to see how much of those Vary cases are bugs versus principled decisions.

annevk avatar Dec 09 '22 14:12 annevk

Yeah we have some early thoughts on that for preloads in https://github.com/WICG/nav-speculation/issues/170 . The tentative conclusion is that we should probably respect Vary: referer, but there isn't a strong use case for much else.

For other web platform caches, I could see how maybe people might get interesting behaviors with Vary: Sec-Fetch-Dest or similar. (But probably aren't doing that today, so, not sure how important it would be to support that...)

domenic avatar Dec 12 '22 02:12 domenic

An update: No-Vary-Search header support for navigational prefetch shipped in Chrome 121, and will ship for prerender in Chrome 127.

Chrome status entries:

liviutinta avatar Jun 12 '24 15:06 liviutinta