Guide : Speculation Rules API

Ce que the Speculation Rules API (prefetch and prerender) en réalité is, si it affecte SEO, exploration, or rankings, and how to implement it sans inflating votre analytics.

Première publication : 3 juil. 2026 · Dernière mise à jour : 3 août 2026 · Advanced
Langues

The Speculation Rules API is a Chromium navigateur fonctionnalité (Chrome/Edge 109+) que lets a site tell le navigateur to prefetch (download the HTML document) or prerender (entièrement charger and render in an invisible tab) same-site pages avant a visitor clicks — so the suivant navigation feels near-instant. Prefetch pays bas TTFB; prerender additionally pays bas FCP and LCP. It n’est pas a exploration, indexation, or ranking mechanism — Googlebot doesn't besoin resource hints comme ce and Google publishes aucun Search documentation on it. Recherche Google itself uses the API to prefetch its top results, and Ray-Ban reported grand conversion and LCP gains from prerendering, so the réel valeur is Core Web Vitals and UX pour réel visitors. The big risk to manage is analytics: a speculated page que fires une pageview avant the utilisateur sees it va inflate GA4 unless the tracking checks document.prerendering. WordPress 6,8 ships a conservative, prefetch-only version on by par défaut pour logged-out utilisateurs.

Evidence for this claim The Speculation Rules API lets supporting browsers prefetch or prerender likely future navigations. Scope: Browser navigation optimization; support and restrictions vary by browser version. Confidence: high · Verified: Chrome Developers: Speculation Rules API Evidence for this claim Prerendering executes a page before activation, so analytics and side effects must account for the prerendering lifecycle. Scope: Supporting browsers and prerendered documents. Confidence: high · Verified: web.dev: Speculation rules

TL;DR — The Speculation Rules API (Chromium, Chrome/Edge 109+) lets a site declare — in JSON, inline or via a Speculation-Rules header — qui same-site URLs le navigateur devrait prefetch (download the document; pays bas TTFB) or prerender (entièrement récupérer, render, and run JS in an invisible tab; pays bas TTFB + FCP + LCP). Eagerness (immediate/eager/moderate/conservative) contrôle quand a rule fires, separate from qui URLs it targets. It is pas a exploration/indexation/ranking mechanism — Googlebot doesn’t rely on resource hints comme ce (per Illyes’ Feb 2026 comments on hints généralement) and Google publishes aucun Search docs on it. But Recherche Google itself uses it to prefetch its top results, and Ray-Ban reported grand conversion + LCP wins, so the payoff is réel pour réel visitors via Core Web Vitals and UX. Biggest gotchas: analytics double-counting (fix with document.prerendering/prerenderingchange), state-changing GET URLs (logout, add-to-cart) vous doit jamais speculate, and Chromium-only prise en charge. Commencer with prefetch broadly; ajouter prerender to un or two high-confidence pages at la plupart.

Ce que the Speculation Rules API en réalité is

The Speculation Rules API is a navigateur API — Chromium seulement — que lets a site tell le navigateur qui same-site pages to prepare avant a visitor clicks. Per MDN, the API is designed to améliorer performances pour future navigations, and parce que it targets document URLs plutôt que individual resource fichiers, it rend sense pour multi-page sites plutôt que single-page apps. It supersedes the old, deprecated, Chrome-only <link rel="prerender"> and goes au-delà the widely-available <link rel="prefetch"> with a plus expressive JSON syntax.

Rules are declared as JSON, soit inline in a <script type="speculationrules"> block or via a Speculation-Rules HTTP réponse header. Ils peut liste explicit URLs or auto-match liens on lune page via where/href_matches conditions (appelé document rules).

Là are two speculative actions, and getting the distinction correct is the whole game:

  • Prefetch downloads the corps de la réponse of the referenced page — but pas its subresources. It pays bas the suivant page’s TTFB.
  • Prerender récupère, renders, and loads lune page into an invisible in-memory tab: tout subresources, tout JavaScript, même données récupère kicked off by JS. Per MDN, future navigations to a prerendered page are near-instant. It pays bas TTFB and FCP and LCP — but it’s far plus expensive and riskier.

Harry Roberts’ shorthand in his layered-approach write-up captures it bien: prefetch is pour paying bas TTFB, prerender is pour LCP.

Un under-covered technical nuance: speculated resources land in le navigateur’s memory cache, qui is quicker to retrieve que the HTTP cache the older <link rel="prefetch"> hint uses. And a prefetched or prerendered document aussi populates the HTTP cache, so même a speculation the visitor jamais uses isn’t pure waste — a plus tard navigation peut encore benefit.

Eagerness: quand to speculate, separate from qui URLs

A genuinely clever design choice ici is que eagerness is a separate lever from targeting. Barry Pollard’s Chrome blog post on the API’s improvements frames it as separating quand to speculate from qui URLs to speculate on. Là are four levels:

  • immediate — speculate as soon as the rules are seen (on page charger).
  • eager — commencer on the slightest signal.
  • moderate — roughly a 200ms hover (or pointerdown on touch).
  • conservative — pointer- or touch-down, i.e. the visitor has tout but clicked.

Treat ces four trigger definitions as Chrome’s current heuristics, pas a fixed spec — Chrome has modifié the exact mobile triggers plus que une fois (it déplacé moderate to viewport-based heuristics and adjusted eager’s timing as recently as January 2026), so re-check the live docs avant quoting an exact millisecond or percentage threshold in votre propre implementation notes.

Two connexe refinements worth knowing: No-Vary-Search lets le navigateur reuse a mis en cache document que differs seulement by ignorable parameters (e.g. UTM-tagged variants of the même page), and the newer prerender-until-script pattern (covered by CoreWebVitals.io) offers a middle ground entre plain prefetch and a complet prerender — as of ce writing it’s encore an experimental, not-generally-available action running in a Chrome origin trial, pas a shipped par défaut.

Chrome’s propre guardrails

Vous pouvez’t accidentally nuke a visitor’s device with an over-broad rule. Chrome’s prerender documentation sets hard, FIFO caps regardless of votre configuration: pour immediate-eagerness rules, 50 prefetches and 10 prerenders; pour interaction-based (moderate/ conservative) rules, 2 slots. Chrome aussi treats a prerender as a hint and a progressive enhancement, pas a guarantee — it peut decline fondé on the user’s settings or resource constraints — and it won’t render cross-origin iframes on a prerendered page jusqu’à activation. A built-in privacy guard aussi blocks cross-site prefetches quand the utilisateur déjà has cookies définir pour the destination site.

Cross-origin rules, and ce que en réalité se produit à l’intérieur a prerendered page

Per MDN, prerendering is restricted to same-origin documents by par défaut. Cross-origin, same-site prerendering is possible, but seulement si the target page opts in with a Supports-Loading-Mode: credentialed-prerender réponse header — cross-site prerendering isn’t possible at tout as of ce writing. Cross-site prefetch is plus permissive (same-site and cross-site prefetches les deux fonctionner), but encore gated by the no-cookies-set privacy rule ci-dessus; a broader cross-site prefetch opt-in via Supports-Loading-Mode is documented as planned but pas yet shipped.

À l’intérieur the hidden tab, a prerendering page isn’t a normal page charger: intrusive APIs (alert()/confirm()/prompt(), requestFullscreen(), Navigator.share()) are blocked or ignored, async APIs comme geolocation and getUserMedia() are deferred jusqu’à activation, and cross-origin iframes and worker scripts don’t run jusqu’à alors soit. Session storage obtient special handling worth knowing si votre page reads it on charger: a prerendering page starts with a clone of the tab’s session storage, and que clone is discarded in favor of the réel tab’s storage at activation — so tester quelconque session-storage-dependent logic les deux avant and après the prerenderingchange event, pas simplement on a normal charger. Pour timing, document.prerendering and prerenderingchange tell vous the state and the activation moment; PerformanceNavigationTiming.activationStart donne vous the réel elapsed temps entre prerender commencer and activation si vous vouloir to mesurer it.

Fait the Speculation Rules API affecter SEO, exploration, or rankings?

Ce is the question every SEO veut answered, and la plupart competing articles wave it away. The precise réponse has two halves.

Ce que it ne fait pas do

It is pas a exploration, indexation, or ranking mechanism. Là is aucun Recherche Google Central documentation tying the Speculation Rules API to how Googlebot crawls or indexes — parce que it doesn’t touch que couche at tout. It’s a navigateur fonctionnalité pour human visitors in Chromium.

The closest chose to an on-the-record Google statement is Gary Illyes on Search Off the Record (early 2026), talking à propos de resource hints in general — pas the Speculation Rules API by nom. As Moteur de recherche Journal reported, Illyes’ point was que Googlebot’s propre infrastructure has near-infinite bandwidth and very fast DNS resolution, so hints comme DNS-prefetch and preload hold essentially aucun valeur pour its exploration traiter — it peut déjà talk to servers fast and doesn’t besoin to be told to récupérer choses précédent. Treat que as prise en charge pour “ce is a navigateur/visitor fonctionnalité, pas a robot d’exploration un,” but remarque the scope: Illyes was addressing the broader resource-hints family, pas Speculation Rules specifically. Ce is the même discipline the sibling resource hints piece s’applique.

Aussi worth stating plainly parce que personnes demander: Bing has publié nothing on the Speculation Rules API pour le SEO. Edge (Chromium 109+) supports it as a navigateur fonctionnalité, but there’s aucun bingbot or indexation angle — qui is exactly ce que you’d expect pour a rendering-browser fonctionnalité plutôt que a search-engine-crawler un.

Ce que it PEUT do

It peut améliorer Core Web Vitals — surtout LCP, and indirectly INP by front-loading JavaScript execution avant the interaction se produit — pour réel utilisateurs. Core Web Vitals is a documented (si modest) ranking signal via lune page experience system, so there’s an indirect ranking pathway. But the stronger cas is plain UX and conversion: making the suivant page feel instant is a réel business lever independent of rankings.

The non-overclaiming façon to frame it: Speculation Rules won’t obtenir vous crawled or indexé differently — it rend une page feel instant une fois a réel visitor is déjà navigating votre site, qui is a UX and Core Web Vitals lever, pas a robot d’exploration un.

Real-world results

Two proof points do the heavy lifting ici, and les deux come from Google’s propre publications.

Recherche Google uses it on itself. Per the Chrome team’s 2025 announcement, un of the premier uses of speculation rules was to prefetch the premier two search results. The mesuré gains: on Android Chrome, LCP pour clicks from Recherche Google was reduced by 67 milliseconds; on desktop, a similaire 58,6 millisecond LCP improvement. Hover-based prefetching of the remaining results cut desktop FCP by 7,6 milliseconds and LCP by 9,5 milliseconds. Pour cross-origin result prefetches, Google Search routes les via Chrome’s private prefetch proxy to anonymize la requête. Very few competing articles cite que Google trusts ce suffisant to run it on google.com/search at scale — and publié the exact millisecond deltas.

Ray-Ban’s cas study is the business-impact proof. Google’s web.dev cas study reports que après prerendering product pages, mobile taux de conversions on PDPs increased by 101,47% and desktop by 156,16%, with a 43% improvement in LCP on les deux desktop and mobile. Exit rates dropped roughly 13% on les deux, and pages viewed per session rose 51,95% on mobile and 65,30% on desktop. The implementation split is instructive: desktop utilisé moderate eagerness triggered by hovering product tiles; mobile (aucun hover state) utilisé immediate eagerness on simplement the premier four tiles, qui were the most-clicked.

And the scale is déjà grand: WordPress 6,8 (March 2025) ships ce by par défaut, building on a fonctionnalité plugin que was on tens of thousands of sites avant core adoption — meaning a meaningful share of the web déjà has speculation rules running sans anyone configuring les.

How to implement it safely

The consensus adoption order, from les deux Google’s docs and independent experts:

  1. Commencer with prefetch, broadly. Per Chrome’s implementation guide, prefetch is relatively safe pour la plupart sites and is the initial approach nombreux prendre.
  2. Ajouter prerender narrowly, plus tard. Chrome’s docs warn contre over-prerendering at a cost of utilisateur resources, and recommend keeping prerenders bas to un or two pages at la plupart. Harry Roberts reaches the même conclusion independently — a wildcard-like match is aussi greedy, and prerendering everything is usually aussi expensive and aussi risky; an opt-in approach is meilleur.
  3. Utiliser document rules to scale sans per-page config. Plutôt que hand-listing URLs on every page, a where/href_matches condition sources URLs from the document itself so un rule définir peut appliquer site-wide.
  4. Mind votre CSP. Inline <script type="speculationrules"> blocks besoin explicit allowance in script-src — via 'inline-speculation-rules', a hash-source, or a nonce-source — or ils silently échouer quand a Content Security Policy is in placer.

Ce que PAS to prefetch or prerender

Les deux MDN and Chrome’s implementation guide are explicit que some URLs doit jamais be speculated, parce que a speculative récupérer is encore a réel requête que peut trigger réel side effects. The danger liste:

  • Sign-out / logout URLs.
  • “Add to cart” URLs.
  • Language- or currency-switcher URLs.
  • Sign-in flows que trigger an SMS/OTP.
  • URLs que increment a usage allowance or fire ad-conversion tracking.

The root fix is a design un: state changements — comme a /logout action — shouldn’t be plain GET liens que a speculation rule pourrait récupérer in the premier placer.

Prerender is stricter encore. Additionally unsafe to prerender: pages que modify client-side storage on charger, send analytics or ad-impressions on charger, or sinon causer side effects as si the utilisateur had interacted. MDN’s framing is que prerendering is riskier que prefetching and devrait be fait sparingly, seulement où it’s worth it.

Fixing the analytics problem

Ce is the trap que catches réel sites. A prerendered page entièrement loads avant the utilisateur ever sees it. Si a page_view (or an ad impression, or a Meta Pixel event) fires on charger, you’ve logged a visit que didn’t se produire — inflating GA4 sessions and corrupting attribution.

The mechanism to fix it is documented in MDN and Chrome’s guides:

  • document.prerendering is true pendant que une page is being prerendered.
  • The prerenderingchange event fires on activation (quand the utilisateur en réalité navigates in).
  • Servers peut aussi detect speculative requêtes via the Sec-Purpose requête header (prefetch, or prefetch;prerender).

The practical reality: per Chrome’s implementation guide, some analytics providers (Google Analytics) and ad providers (Google Publisher Tag) déjà prise en charge speculation rules and won’t log a view jusqu’à lune page is activated. GA4’s propre gtag.js handles it pour vous. Ce que typically doesn’t handle it by par défaut: custom GTM tags, Meta Pixel, and homegrown scripts. Pour tag-manager setups, un clean approach is to delay the tag manager script itself, or gate spécifique code jusqu’à lune page is activated or made visible. There’s a documented real-world version of getting ce incorrect — WordPress 6,8 sites reportedly firing GA4 and Meta Pixel ghost visits après the fonctionnalité auto-enabled; Erwin Hofman covers the fix in depth.

Ce tempers ROI expectations and la plupart articles bury it: the Speculation Rules API is Chromium-only (Chrome and Edge 109+). It is pas Baseline. Firefox has a positive standards position on the prefetch portion seulement and hasn’t shipped it; Safari has an implementation behind a flag, off by par défaut. A meaningful share of quelconque site’s trafic — everyone on Firefox and Safari — obtient zero benefit, so size votre expectations accordingly.

Speculation Rules in WordPress 6,8+

Parce que so beaucoup of the search audience is on WordPress and got ce by par défaut: WordPress 6,8 (March 2025) ships built-in Speculative Chargement, on by par défaut pour logged-out visitors, en utilisant a conservative, prefetch-only configuration out of the box. Site owners peut customize the behavior — notamment opting into prerender pour clé URLs — via the wp_speculation_rules_configuration filter (Weston Ruter, a Google engineer and WordPress core contributor, has a walkthrough). The par défaut is deliberately safe, qui is pourquoi la plupart WordPress sites peut leave it on — but it’s aussi pourquoi the analytics gotcha ci-dessus surprised a lot of site owners who jamais chose to enable anything.

Myths, debunked

  • “Speculation Rules will help Googlebot crawl my site faster.” Aucun — it’s a browser-rendering fonctionnalité pour human visitors in Chromium; Googlebot’s propre infrastructure doesn’t besoin hints comme ce, and aucun Google doc liens the API to exploration.
  • “It’s the same as <link rel="prefetch">/<link rel="prerender">.” Pas quite — it supersedes the deprecated Chrome-only rel="prerender", adds a richer JSON syntax (document rules, eagerness), and stores speculated resources in the memory cache plutôt que the HTTP cache.
  • “Prerendering everything makes my whole site instant with no downside.” Aucun — Chrome warns contre over-prerendering, enforces hard caps, and les deux Google and Harry Roberts recommend at la plupart un or two prerendered pages.
  • “If I add speculation rules my analytics just works.” Seulement si every analytics and ad script defers via document.prerendering/prerenderingchange. GA4 handles it; nombreux GTM tags and third-party pixels don’t.
  • “It’s universally supported, so it’s a safe default for all traffic.” Aucun — Chromium-only, pas Baseline; Firefox and Safari don’t ship it by par défaut.
  • “Prefetch is risk-free, so I can wildcard it.” Overstated — a wildcard-like match is aussi greedy, surtout pour state-changing GET URLs que devrait jamais be fetchable liens in the premier placer.
  • “This will directly move my rankings.” Pas established by quelconque official source as a direct ranking factor. The credible chain is Speculation Rules → meilleur real-user Core Web Vitals / conversion → the existing, modest page-experience signal, plus business wins que matter regardless of rankings.

Où ce sits

Ce is a web performances topic, pas a exploration un — and keeping que line clean is the point. It’s a fermer cousin of resource hints (preload/preconnect/dns-prefetch/prefetch), qui share the “browser does network work earlier” idea and the même “doesn’t help Googlebot” caveat; it feeds Core Web Vitals (LCP surtout); and it interacts with mise en cache and a CDN since speculated documents populate caches. Pour the crawler-side analogue of “ask before you re-fetch,” the conditional-requests topic covers how Googlebot avoids re-downloading unchanged pages — a différent couche (robot d’exploration, pas navigateur), même discipline of separating mechanics from ranking impact.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.