Speculation Rules: Prefetch & Prerender

Runners sent ahead: real prefetch rules in this page, then the arriving page reads its own deliveryType; the links eager would sweep counted, prerender…

Why it matters

A navigation whose document is already waiting feels instant. But every wrong guess eats the visitor’s data, and prerender runs the next page’s JavaScript before it is opened: analytics, API calls, whatever the page does.

The key idea

A page does not see its runners; it only learns how it arrived

Common mistakes

Try it in this playground