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
Put eager on every link to make it all instant: why so wasteful?eager (and immediate) fetch every matching link though it is never clicked, up to Chrome’s limits, and sweep up links that do something too. Narrow with selector_matches or href_matches, leave actions out with not, and use moderate (when pointed at) or conservative (when pressed).
prerender is just a faster prefetch, right? No: prerender runs the next page’s JavaScript in a hidden tab, so analytics may be recorded and APIs called for a page never opened. A page that allows prerender checks document.prerendering and holds such work until the prerenderingchange event.
Why is prerendering another origin or a checkout page unsafe? Pages with side effects (checkout, sign-out, add-to-cart by GET) can be set off just by being guessed. Prerendering another origin needs that origin’s permission (the Supports-Loading-Mode header), and a cross-site prefetch goes without cookies. Speculate only pages that are safe to open twice, or not at all.
Try it in this playground
Put a prefetch in, then run with Bagas On arrival, read its deliveryType.
Run again with no rule Compare its responseStart.
Count the links for "/*" How many documents would eager sweep up?
Read this page’s activationStart Above 0 means it was prerendered.