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.
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.
TL;DR — The Speculation Rules API lets votre site tell Chrome or Edge to charger the suivant page a visitor is probable to click — quietly, in the background — avant ils click it. Quand ils do click, lune page peut apparaître almost instantly. It’s a speed fonctionnalité pour réel personnes en utilisant Chromium navigateurs. It fait pas aider Google explorer or rank votre site, but it peut faire pages feel faster, qui is bon pour utilisateurs (and, indirectly, pour Core Web Vitals).
Ce que c’est
Normally, quand vous click a lien, le navigateur starts fetching que page from scratch — and vous wait. The Speculation Rules API lets a site obtenir a head commencer: it indique le navigateur “the visitor va probably go ici suivant, so commencer getting it ready now.” Quand the click finalement se produit, le navigateur swaps in lune page it déjà prepared au lieu de starting over.
Là are two versions of “getting it ready,” and the difference matters:
- Prefetch — le navigateur quietly downloads the suivant page’s HTML in the background. Lighter weight, lower risk.
- Prerender — le navigateur entièrement loads and renders the suivant page in an invisible tab, running its JavaScript and everything. Heavier, but lune page peut apparaître truly instantly. Riskier, so vous utiliser it sparingly.
Vous définir ce up with a petit block of JSON on votre page. Vous pouvez liste exact URLs, or tell le navigateur “prepare any link the visitor hovers over.”
Fait it aider SEO?
Short version: pas the façon personnes hope. It won’t obtenir vous crawled or indexé faster. Googlebot doesn’t besoin ce — it’s a fonctionnalité pour human visitors in Chrome and Edge, pas pour search bots.
Ce que it peut do is faire votre pages feel faster une fois someone is déjà on votre site, clicking autour. Faster real-world experiences feed into Core Web Vitals, qui is a (modest) ranking signal — and, plus importantly, faster pages tend to convert meilleur. Ray-Ban, Par exemple, reported a big jump in conversions après prerendering product pages.
The un chose to watch out pour
Votre analytics peut lie to vous. Si le navigateur prerenders une page avant the visitor ever sees it, and que page fires a “pageview” the moment it loads, votre analytics va count a visit que jamais happened. Google Analytics 4’s propre script handles ce correctement on its propre — but nombreux autre tags and pixels don’t, and they’ll log phantom pageviews unless a developer patches les.
Si you’re on WordPress 6,8 or plus tard, vous déjà have a safe, conservative version of ce turned on by par défaut (prefetch seulement, pour logged-out visitors). Vous didn’t have to do anything — it came with an mettre à jour.
Vouloir the complet picture — prefetch vs. prerender in detail, eagerness levels, the “never prerender this” liste, and Comment corriger the analytics problem? Switch to the Avancé tab.
TL;DR — The Speculation Rules API (Chromium, Chrome/Edge 109+) lets a site declare — in JSON, inline or via a
Speculation-Rulesheader — 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 withdocument.prerendering/prerenderingchange), state-changingGETURLs (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:
- Commencer with prefetch, broadly. Per Chrome’s implementation guide, prefetch is relatively safe pour la plupart sites and is the initial approach nombreux prendre.
- 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.
- Utiliser document rules to scale sans per-page config. Plutôt que hand-listing
URLs on every page, a
where/href_matchescondition sources URLs from the document itself so un rule définir peut appliquer site-wide. - Mind votre CSP. Inline
<script type="speculationrules">blocks besoin explicit allowance inscript-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.prerenderingistruependant que une page is being prerendered.- The
prerenderingchangeevent fires on activation (quand the utilisateur en réalité navigates in). - Servers peut aussi detect speculative requêtes via the
Sec-Purposerequête header (prefetch, orprefetch;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.
Navigateur prise en charge reality vérifier
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-onlyrel="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
GETURLs 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.
AI summary
A condensed prendre on the Avancé version:
- Ce que c’est: a Chromium-only (Chrome/Edge 109+) navigateur API to prefetch
(download the HTML document; pays bas TTFB) or prerender (entièrement charger + run JS
in an invisible tab; pays bas TTFB + FCP + LCP) same-site pages avant a click.
Declared as JSON inline or via a
Speculation-Rulesheader. - Eagerness (
immediate/eager/moderate/conservative) contrôle quand a rule fires, separate from qui URLs it targets. Chrome enforces hard caps (50 prefetches / 10 prerenders pour immediate rules); the exact triggers are Chrome-version-dependent heuristics, pas fixed constants. - Cross-origin: prerender is same-origin by par défaut; cross-origin same-site
prerender nécessite the target’s opt-in (
Supports-Loading-Mode: credentialed-prerender); cross-site prerender isn’t possible at tout. Prefetch is plus permissive but encore gated by a no-destination-cookies privacy rule. - SEO reality: pas a exploration/indexation/ranking mechanism — Googlebot doesn’t besoin resource hints (per Illyes, Feb 2026, on hints généralement) and Google has aucun Search doc on it. Bing has publié nothing. It peut déplacer Core Web Vitals (LCP/INP) and conversions pour réel utilisateurs — an indirect ranking + UX lever.
- Proof it fonctionne: Recherche Google prefetches its top two results (LCP bas ~58–67ms); Ray-Ban reported ~100–156% conversion lifts and a 43% LCP improvement from prerendering PDPs.
- Biggest risk — analytics: a speculated page firing une pageview on charger inflates
GA4. Fix with
document.prerendering/prerenderingchange. GA4 handles it natively; GTM custom tags and Meta Pixel souvent don’t. - Jamais speculate state-changing
GETURLs: logout, add-to-cart, currency/lang switchers, OTP sign-in. Redesign ceux offGETliens. - Adoption order: prefetch broadly, ajouter prerender to un or two pages max, mind
CSP (
'inline-speculation-rules'). - WordPress 6,8+ ships conservative, prefetch-only speculative chargement on by
par défaut pour logged-out utilisateurs (
wp_speculation_rules_configurationfilter to customize).
Documentation officielle
Primary-source documentation. Remarque: the moteur de recherches publish nothing on ce as an SEO topic — the authoritative docs are navigateur/standards références.
MDN / standards
- Speculation Rules API — the technical référence: syntax, prefetch vs. prerender, privacy, CSP, and browser-compatibility status.
- Speculation-Rules HTTP header — declaring rules via une réponse header au lieu de an inline script.
Chrome pour Developers (Google)
- Prerender pages in Chrome pour instant page navigations — how prerender fonctionne, the hint-not-guarantee framing, and Chrome’s FIFO caps.
- Guide to implementing speculation rules pour plus complex sites — the analytics warning, third-party-script handling, and state-change cautions.
- Improvements to the Speculation Rules API (Barry Pollard, 2024) — document rules, eagerness,
No-Vary-Search, HTTP-cache reuse. - Recherche Google now uses the Speculation Rules API (Pollard & Busaryev, 2025) — Google’s propre usage and the mesuré LCP/FCP deltas.
web.dev (Google)
- How Ray-Ban doubled taux de conversion… via prerendering — the business-impact cas study.
- Prefetching, prerendering, and precaching — memory cache vs. HTTP cache, and quand to be cautious.
WordPress (official fonctionnalité docs)
- Speculative Chargement in 6,8 (Faire WordPress Core) — the par défaut behavior and configuration filter.
- Speculative Chargement fonctionnalité plugin — the plugin core adoption was fondé on.
Quotes from the source
Statements from the principal navigateur/standards documentation and Google’s propre publications. Parce que ce isn’t a search-engine SEO topic, là are aucun Google Search quotes — the sources are Chrome/MDN/web.dev.
MDN — Ce que c’est and fait
- “The Speculation Rules API is designed to improve performance for future navigations. It targets document URLs rather than specific resource files, and so makes sense for multi-page applications (MPAs) rather than single-page applications (SPAs).” Jump to quote
Chrome — Recherche Google’s propre usage (the strongest proof point)
- “One of the first uses of speculation rules was to prefetch the first two search results.” — Chrome pour Developers blog. Jump to quote
- On Android Chrome, LCP pour clicks from Recherche Google was “reduced by 67 milliseconds.” Jump to quote
- On desktop, a “similar improvement in LCP of 58.6 milliseconds.” Jump to quote
Speculation Rules cheat sheet
Prefetch vs. prerender
| Prefetch | Prerender | |
|---|---|---|
| Ce que it fait | Downloads lune page’s HTML document seulement | Entièrement récupère, renders, and runs JS in an invisible tab |
| Metrics it improves | TTFB | TTFB + FCP + LCP |
| Cost / risk | Lower | Plus élevé (memory, bandwidth, side effects) |
| How beaucoup to utiliser | Broadly is OK | 1–2 high-confidence pages max |
| Où it caches | HTTP cache | In-memory cache (aussi populates HTTP cache) |
Eagerness — quand a rule fires (independent of qui URLs)
| Level | Fires quand… |
|---|---|
immediate | As soon as the rules are parsed (page charger) |
eager | On the slightest signal toward a lien |
moderate | ~200ms hover (pointerdown on touch) |
conservative | Pointer/touch-down — visitor has tout but clicked |
Chrome’s hard caps (regardless of votre config)
immediaterules: 50 prefetches / 10 prerenders.- Interaction-based (
moderate/conservative) rules: 2 FIFO slots.
Cross-origin Référence rapide
- Prerender: same-origin by par défaut; cross-origin same-site nécessite the target to
send
Supports-Loading-Mode: credentialed-prerender; cross-site prerender isn’t possible. - Prefetch: same-site and cross-site les deux fonctionner, gated by the no-destination-cookies privacy rule.
Fast facts
- Prise en charge: Chromium-only (Chrome/Edge 109+). Pas Baseline. Firefox = prefetch standards position seulement (unshipped); Safari = behind a flag, off by par défaut.
- Declared as JSON: inline
<script type="speculationrules">or aSpeculation-RulesHTTP header. - CSP: inline blocks besoin
'inline-speculation-rules'(or hash/nonce) inscript-src. - Detect a speculative charger:
document.prerendering, theprerenderingchangeevent, or theSec-Purposerequête header. - Pas a Google ranking/explorer signal. Recherche Google uses it (top-2 results, ~58–67ms LCP). WordPress 6,8+ = conservative, prefetch-only, logged-out, on by par défaut.
Ce que pas to do
Speculating state-changing GET URLs.
A speculative récupérer is a réel requête. Jamais prefetch or prerender logout,
add-to-cart, currency/language switchers, OTP-triggering sign-in flows, or
allowance-incrementing URLs. The réel fix is design: ceux actions shouldn’t be
plain GET liens a rule pourrait récupérer. Ce is documented in les deux MDN and Chrome’s
implementation guide.
Prerendering broadly or with a wildcard. Chrome caps it and warns contre over-prerendering at a cost of utilisateur resources; Harry Roberts calls a wildcard-like match aussi greedy. Garder prerenders to un or two high-confidence pages.
Assuming votre analytics is fine.
Si a prerendered page fires une pageview on charger, you’ll inflate GA4 with visits que
jamais happened. GA4’s gtag.js handles ce — but GTM custom tags, Meta Pixel, and
homegrown scripts souvent don’t. WordPress 6,8 sites reportedly logged GA4/Meta ghost
visits après the fonctionnalité auto-enabled. Gate tracking on document.prerendering /
prerenderingchange.
Forgetting votre CSP.
An inline <script type="speculationrules"> silently fails sous a Content Security
Policy unless script-src permet 'inline-speculation-rules' (or a hash/nonce).
Expecting it to aider exploration or rankings. It doesn’t touch Googlebot. Selling ce internally as an “SEO fix pour budget d’exploration or rankings” sets the incorrect expectation — pitch it as a Core Web Vitals / conversion win pour réel Chromium visitors.
Over-estimating reach. It’s Chromium-only. Firefox and Safari utilisateurs obtenir nothing by par défaut, so don’t model ROI as si it s’applique to tout trafic.
Worked exemples
Minimal, illustrative rule blocks. Adapt targeting to votre propre site and toujours exclude state-changing URLs.
1. Prefetch two explicit URLs (safest starting point)
<script type="speculationrules">
{
"prefetch": [
{ "urls": ["/pricing/", "/features/"] }
]
}
</script>2. Document rules — prefetch same-site liens on hover (moderate)
<script type="speculationrules">
{
"prefetch": [
{
"where": { "href_matches": "/*" },
"eagerness": "moderate"
}
]
}
</script>3. Prerender un high-confidence page, excluding dangerous paths
<script type="speculationrules">
{
"prerender": [
{
"where": {
"and": [
{ "href_matches": "/*" },
{ "not": { "href_matches": "/logout*" } },
{ "not": { "href_matches": "/cart*" } }
]
},
"eagerness": "conservative"
}
]
}
</script>4. Deliver rules via HTTP header au lieu de an inline script
Speculation-Rules: "/speculation-rules.json"…où /speculation-rules.json renvoie the même JSON with a
application/speculationrules+json content type. Utile quand a strict CSP rend
inline scripts painful.
5. Guard analytics contre firing during prerender
if (document.prerendering) {
document.addEventListener('prerenderingchange', sendPageview, { once: true });
} else {
sendPageview();
}Ce defers lune pageview jusqu’à lune page is en réalité activated — the même pattern GA4’s propre script uses.
Analytics jumped après prerender shipped
- Pause the prerender rule, pas the whole performances program. Garder a copy of the deployed rule and switch the affected chemin back to prefetch or aucun speculation. Si the unexplained trafic arrête, continuer with the prerender investigation.
- Separate activation from background charger. Reproduce in Chromium and inspect
document.prerenderingavant navigation. Si analytics fires pendant que it istrue, the tag records une page the visitor has pas activated. - Identifier the firing owner. Vérifier GA4, custom GTM tags, ad pixels, and homegrown events independently. Si seulement un source inflates, fix que integration plutôt que weakening every rule.
- Gate the event. Delay lune pageview or impression jusqu’à
prerenderingchange/activation. Si the provider déjà supports prerendering, supprimer duplicate custom firing logic. - Replay the abandoned-navigation cas. Trigger a prerender but ne faites pas click. The event doit remain absent. Alors activate lune page une fois and confirmer exactly un event is recorded.
- Restore narrowly. Re-enable un high-confidence prerender target, comparer activated navigations with analytics events, and expand seulement quand counts remain aligned.
Examiner a rule définir pour side effects
Review this Speculation Rules JSON and a list of site routes. Classify every matched
route as safe to prefetch, safe to prerender, or exclude. Explicitly flag logout,
add-to-cart, language/currency switching, OTP, allowance-changing, analytics, storage,
and ad-impression side effects. Check eagerness, scope, and likely resource waste.
Return the smallest safe rule set plus validation and rollback tests. Do not claim a
crawling, indexing, or direct ranking benefit.Design a staged rollout
Create a staged Speculation Rules rollout for this click-path data and browser mix.
Start with prefetch, choose at most one or two high-confidence prerender targets, and
explain why each route is likely enough to justify its cost. Include Chromium-only
segmentation, analytics activation handling, CSP checks, success metrics, an abandoned
navigation test, and rollback triggers. Do not invent conversion or performance gains.Debug manquant speculation
Given this page markup, response headers, CSP, browser version, and DevTools evidence,
diagnose why a speculation rule was not used. Check invalid JSON, CSP blocking,
unsupported browser, rule mismatch, resource limits, cross-origin restrictions, and
browser discretion. Return symptom, evidence, likely cause, smallest fix, and the
exact evidence that would confirm it. Safe speculation release checklist
- Browser-support données justifies a Chromium-only progressive enhancement.
- Initial rollout uses prefetch; prerender is limited to un or two high-confidence destinations.
- Logout, cart mutation, login/OTP, language/currency, allowance-changing, and autre state-changing OBTENIR routes are excluded.
- Prerendered pages ne faites pas mutate storage or fire impressions avant activation.
- Session-storage-dependent logic is testé les deux avant and après
prerenderingchange(a prerendering page starts with a storage clone that’s discarded at activation). - Quelconque cross-origin prerender target sends
Supports-Loading-Mode: credentialed-prerender; cross-site prerender isn’t attempted at tout. - Custom analytics and pixels vérifier
document.prerenderingand wait pourprerenderingchangequand necessary. - CSP permits the inline or external speculation-rules delivery méthode.
- Targeting and eagerness come from observed navigation behavior, pas a wildcard guess.
- DevTools confirms the rule is valid, eligible, and utilisé seulement pour intended URLs.
- An abandoned speculative charger records aucun pageview, conversion, or state modifier.
- Safari and Firefox encore recevoir a entièrement functional normal navigation.
- Performances and business outcomes are mesuré on activated navigations, with wasted speculation tracked separately.
Activation and analytics integrity
Tester to run: Trigger a prerender sans clicking, alors repeat and activate the page une fois pendant que observing analytics and custom pixel requêtes.
Attendu result: The abandoned prerender records aucun pageview or impression; the activated navigation records exactly un.
Échec interpretation: A tag fires on background charger or duplicate activation logic records the même visit twice.
Monitoring window: Tester avant release, immédiatement après release, and après tag manager or analytics-library changements.
Rollback trigger: Disable prerender pour the affected route si speculative loads inflate sessions, impressions, conversions, or attribution.
Navigation performances and waste
Tester to run: Comparer matched activated navigations with and sans the rule, and count speculations que are jamais activated.
Attendu result: Targeted Chromium navigations montrer précédent document/paint timing sans an unacceptable volume of unused fonctionner or current-page regressions.
Échec interpretation: The prediction is weak, eagerness is aussi aggressive, or background fonctionner competes with the current page.
Monitoring window: Examiner during a limited rollout à travers representative devices and connection classes avant expanding scope.
Rollback trigger: Step back from prerender to prefetch, or supprimer the rule, si unused requêtes or regressions outweigh the mesuré activated-navigation benefit.
Side-effect exclusion
Tester to run: Exercise every matched route sans activation and inspect server state, authentication, cart contents, messaging, and usage counters.
Attendu result: Aucun speculative requête changements utilisateur or server state.
Échec interpretation: A state-changing OBTENIR route was matched or une page executes side effects during background charger.
Monitoring window: Re-run quand routes, document-rule selectors, or application side effects modifier.
Rollback trigger: Supprimer the match immédiatement si a speculative requête logs out a utilisateur, changements a cart, sends a message, consumes an allowance, or records a conversion.
Speculative-navigation scorecard
Metric: Activated-navigation performances pour eligible Chromium utilisateurs, paired with speculation activation rate and analytics-event accuracy.
Ce que it indique vous: Si prediction rend réel next-page navigations faster, how souvent prefetched/prerendered fonctionner is en réalité utilisé, and si measurement stays trustworthy.
How to pull it: Segment real-user navigation and paint timings by navigateur and rule exposure; log speculation candidates and activations; comparer activated pageviews with analytics events. Garder prefetch and prerender cohorts separate.
Benchmark or realistic range: Utiliser le site’s propre pre-release distribution and a controlled holdout. Là is aucun honest universal activation-rate or conversion target; navigateur mix, chemin predictability, page weight, and intent differ by site.
Cadence: Watch resource utiliser and analytics integrity during rollout, examiner performances and activation weekly pendant que tuning rules, and re-audit après navigation, tagging, CSP, or browser-support changements.
Ressources utiles
My connexe writing
- The Beginner’s Guide to SEO technique — où page-experience and performances topics comme ce fit in the bigger picture.
- Core Web Vitals: Ce que Ils Are and How to Améliorer Les — the LCP/INP metrics que Speculation Rules en réalité moves pour réel utilisateurs. (Remarque: I don’t yet have a dedicated Ahrefs guide specifically on the Speculation Rules API — ce piece is the deep dive; the liens ici are my closest adjacent coverage.)
My speaking
- What’s Suivant pour Page Experience — SMX Suivant 2021 (SlideShare) — my page-experience talk que flagged early-loading techniques (a “Get Things Earlier” slide linking to the then-experimental speculative prerendering), qui predates the modern Speculation Rules API but points at the même idea.
- How Search Fonctionne (SlideShare) — exploration, rendering, indexation, and ranking, utile pour keeping le navigateur couche separate from the robot d’exploration couche. (My standing disclaimer s’applique: “This is my understanding of systems… not going to be 100% complete or accurate.”)
From autour the industry
- Recherche Google now uses the Speculation Rules API (Chrome pour Developers) — Google’s propre usage, with the LCP/FCP millisecond deltas.
- How Ray-Ban doubled taux de conversion… via prerendering (web.dev) — the meilleur business-impact cas study on prerendering.
- A Layered Approach to Speculation Rules (Harry Roberts, CSS Wizardry) — the strongest independent-expert implementation write-up, notamment the “prefetch for TTFB, prerender for LCP” model.
- Google Explique Pourquoi Its Robot d’exploration Ignores Votre Resource Hints (Moteur de recherche Journal) — Illyes’ Feb 2026 comments on pourquoi Googlebot doesn’t benefit from resource hints (general, pas Speculation-Rules-specific).
- Recherche Google now uses Speculation Rules API to faire search faster (Moteur de recherche Land) — trade-press corroboration of the Chrome announcement.
- Prevent skewed analytics quand en utilisant Speculation Rules (Erwin Hofman) — an in-depth fix pour the GA4 contamination problem.
- Eagerly Prerender Clé URLs with Speculative Chargement in WordPress (Weston Ruter, Google/WordPress core) — how to customize WordPress 6,8’s par défaut via the
wp_speculation_rules_configurationfilter. - Blazing Fast Websites with Speculation Rules (DebugBear) — a performance-tool vendor’s practical walkthrough.
Testez vos connaissances: Speculation Rules
Five rapide questions on ce que the Speculation Rules API fait — and doesn’t — do. Pick an réponse pour chaque, alors vérifier.
Journal des modifications
Mis à jour le 18 juil. 2026.
Résumé éditorial et détails enregistrés des changements.Détails des changements
-
Les notes détaillées des changements sont actuellement disponibles en anglais.
-
Les notes détaillées des changements sont actuellement disponibles en anglais.
Comparaison complète indisponible — aucun instantané antérieur n’a été archivé pour cette révision.