Skip to content

Commit 4b59f02

Browse files
committed
Add section about allowing unknown params
1 parent ba921cf commit 4b59f02

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

_posts/2026-05-07-better-browser-caching-with-no-vary-search.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,46 @@ existing ⚠️ iconography in the _Network_ panel’s title would be really hel
274274
here: not because anything is wrong per se, but because the browser may be doing
275275
something surprising unless you know to look for the `No-Vary-Search` header.
276276

277+
## Unknown Params Should Bust Cache
278+
279+
One of the trickier practical problems with `No-Vary-Search` is keeping it all
280+
in sync. The marketing team may start using a new `utm_*` parameter, or an
281+
ecommerce team may ship a new filter or facet, and unless that change is
282+
reflected in the `No-Vary-Search` header, caching behaviour may well differ from
283+
the ideal scenario.
284+
285+
For that reason, the sensible and defensive default is to **always let new and
286+
unknown parameters vary the cache key**. In other words, if you do not yet know
287+
whether a parameter is meaningful, treat it as semantic until proven otherwise.
288+
289+
Imagine marketing starts adding new params, e.g.:
290+
291+
* `?utm_campaign_variant=summer-a`
292+
* `?utm_campaign_variant=summer-b`
293+
294+
If those parameters are absent from `No-Vary-Search`, then yes, you will miss
295+
out on some caching opportunities, but that is no slower than the situation
296+
we’ve lived with all along. The worst case scenario is just the status quo:
297+
separate cache entries for URLs that are materially the same.
298+
299+
On the flip side, imagine the ecommerce team introduces:
300+
301+
* `?material=leather`
302+
* `?material=canvas`
303+
304+
If _those_ parameters are absent from `No-Vary-Search`, that is by far the safer
305+
outcome. We’d much rather let them produce separate cache entries than
306+
accidentally fold distinct pages into one.
307+
308+
This is the same basic principle I recently wrote about in [<cite>When All You
309+
Can Do Is All or Nothing, Do
310+
Nothing</cite>](/2026/03/when-all-you-can-do-is-all-or-nothing-do-nothing/):
311+
when the system lacks the context to be precise, the safer fallback is usually
312+
the less clever one. In this case, that means allowing unknown parameters to
313+
bust cache until someone has explicitly decided they are safe to ignore.
314+
315+
Again, this is not wasteful—it’s just the same behaviour we’ve always had.
316+
277317
## Use It Carefully
278318

279319
This header is only as good as the assumptions behind it: if two URLs really do

0 commit comments

Comments
 (0)