v144 · performance

Speculation Rules: prerender-until-script Action

This extends speculation rules to introduce a new action called prerender_until_script.

concepts

  1. Until Script

    A new `until` mode for speculation rules — prerender activates only after the user takes a script-triggered action (button click, search submission).

  2. Search-as-you-type Prerender

    A search box that rewrites a speculationrules <script> on each keystroke, prerendering the top hit and waiting for navigator.activatePrerender() before swap.

  3. Checkout Warmup

    Multi-step form pattern: warm the final “confirm” page from step one, refine the speculation per step, then activate the instant the user submits. Full timeline of warmed vs activated.

  4. Timing Dashboard

    Side-by-side TTFB / LCP bar chart comparing navigation with and without prerender active. Tracks prerender phases (injected → warming → ready) and reads real PerformanceNavigationTiming data.

why it shipped

The Speculation Rules API provides developers with powerful tools for speeding up navigations, including prefetch for fetching a document and prerender for fully rendering it.

references