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

  1. 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.

  2. Cart-mutation invalidation

    The Shopify pattern: every /cart/* POST returns "prefetchCache", "prerenderCache" so a warmed /checkout can’t show a stale total. Watch speculative copies flip stale → cleared.

  3. 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.

  4. Prerender invalidation demo

    Simulate populating prefetch and prerender caches with three URLs, then send a selective Clear-Site-Data header. 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.

  5. 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.

references