← Graph

Speculation Rules API

concept 2 connections

Declarative browser API specified as a JSON blob that tells the browser to prefetch HTML documents or fully prerender pages. Supports URL matching and CSS selectors, combined with 'eagerness' levels — conservative (on click), moderate/eager (on hover), or immediate (whenever the browser is idle). Behind the scenes a prerender creates a hidden second tab that becomes visible instantly on click — faster than any React SPA because there's no DOM mutation step. Trade-off: prerender is resource-heavy and speculative, and running JavaScript during prerender can confuse analytics. Google is implementing 'prerender-until-script', which halts at the first script tag — getting most of the benefit without the analytics headache. Chrome supports both prefetch and prerender today; Safari is about to ship prefetch but has concerns about prerender (technical or privacy).

category
pattern
Second of five APIs — prefetch/prerender for instant navigation.
related_to
Speculation Rules API concept
Middle-ground eagerness/action being added to Speculation Rules.

Provenance

Read by
1 extraction