v138 · performance
Add prefetchCache and prerenderCache to Clear-Site-Data header
Two new values for the Clear-Site-Data header to help developers target clearing the prerender and prefetch cache: "prefetchCache" and "prerenderCache".
concepts
-
Clear-Site-Data builder
Tick the storage tiers to clear — including the two new ones — and watch the header and the resulting browser state assemble live. Logout-flow shape.
-
Cart-mutation invalidation
The Shopify pattern: every
/cart/*POST returns"prefetchCache", "prerenderCache"so a warmed/checkoutcan’t show a stale total. Watch speculative copies flip stale → cleared. -
Token explorer
All six Clear-Site-Data directives plus the wildcard, an impact matrix showing exactly what each kills and what survives, plus a pre-v138 vs v138 side-by-side comparison of the canonical logout response.
-
Prerender invalidation demo
Simulate populating prefetch and prerender caches with three URLs, then send a selective
Clear-Site-Dataheader. Build the exact header value with checkboxes, watch which entries flip to cleared, and observe whether the next navigation results in a cache hit or miss. -
Active Prerender Race
The edge case that matters for e-commerce: a prerender is warming, then a cart-mutation POST fires
Clear-Site-Data: "prerenderCache", and the user clicks through. Three controllable scenarios — clear before nav (safe), no clear (stale hit), navigate before clear (stale) — show how the race plays out and when the spec's "cancel active prerenders" rule fires.
why it shipped
Currently, the only way to clear the prefetch and prerender cache is through either the Clear-Site-Data header "cache" value or manually having the UA clear their browsing data cache. With the increased adoption of Speculation Rules, developers want a way to target specifically clearing prefetches, prerenders, or both, without disrupting other session information, such as history, cookies, etc.