Speculative prerendering

Slap yourself if

You think speculative prerendering is just prefetching with a different name.

Why this exists

Speculative prerendering exists because the fastest navigation is the one that already happened. When user intent can be predicted, rendering ahead of time collapses perceived latency — at the cost of doing work that may never be used.

Mental model

Speculative prerendering is executing a future navigation in a parallel reality. You pay real CPU, memory, and network costs now to potentially skip time later.

  • The browser predicts a likely next navigation.
  • A hidden page is fetched, parsed, and rendered offscreen.
  • Scripts may execute in an isolated prerender context.
  • If the user navigates, the prerendered page is activated instantly.
  • If not, all that work is discarded.
  • Treating prerendered pages as side-effect free.
  • Triggering analytics or mutations during prerender.
  • Over-prerendering and saturating CPU or memory.
  • Assuming prerender always upgrades to activation.

Speculative prerendering renders a likely future navigation in advance so activation can be instant, trading extra resource usage for lower perceived latency when the prediction is correct.

  • Business logic running unguarded during prerender
  • Global side effects assumed safe before activation
  • Aggressive heuristics without rollback thinking
  • No visibility into prerender discard rates

Deep dive

Requires Pro

Premium deep dives include more internals, more scars.

What actually runs during a prerender

How speculative work backfires

Latency wins versus wasted work

Debugging prerender-related issues

When speculative prerendering is a liability