Speculation aturan API

What Speculation aturan API (prefetch dan prerender) actually adalah, whether ini affects SEO, crawling, atau rankings, dan cara implement ini without inflating Anda analytics.

Pertama kali diterbitkan: 3 Jul 2026 · Terakhir diperbarui: 3 Agu 2026 · Advanced
Bahasa

Speculation aturan API adalah sebuah Chromium browser fitur (Chrome/Edge 109+) itu lets sebuah situs tell browser untuk prefetch (download HTML document) atau prerender (fully muat dan render di sebuah invisible tab) sama-situs halaman sebelum sebuah pengunjung clicks — so next navigation feels near-instant. Prefetch pays down TTFB; prerender additionally pays down FCP dan LCP. ini adalah not sebuah crawling, pengindeksan, atau peringkat mechanism — Googlebot doesn't perlu resource hints like ini dan Google publishes no Search documentation pada ini. Google Search itself menggunakan API untuk prefetch -nya top hasil, dan Ray-Ban reported besar conversion dan LCP gains dari prerendering, so nyata nilai adalah Core Web Vitals dan UX untuk actual pengunjung. big risk untuk manage adalah analytics: sebuah speculated halaman itu fires sebuah pageview sebelum pengguna sees ini akan inflate GA4 unless tracking memeriksa document.prerendering. WordPress 6.8 ships sebuah conservative, prefetch-hanya versi pada oleh default untuk logged-out pengguna.

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 — Speculation aturan API (Chromium, Chrome/Edge 109+) lets sebuah situs declare — di JSON, inline atau via sebuah Speculation-Rules header — which sama-situs URLs browser seharusnya prefetch (download document; pays down TTFB) atau prerender (fully fetch, render, dan run JS di sebuah invisible tab; pays down TTFB + FCP + LCP). Eagerness (immediate/eager/moderate/conservative) controls when sebuah aturan fires, separate dari which URLs ini targets. ini adalah not sebuah crawling/pengindeksan/peringkat mechanism — Googlebot doesn’t rely pada resource hints like ini (per Illyes’ Feb 2026 comments pada hints umumnya) dan Google publishes no Search docs pada ini. tetapi Google Search itself menggunakan ini untuk prefetch -nya top hasil, dan Ray-Ban reported besar conversion + LCP wins, so payoff adalah nyata untuk actual pengunjung via Core Web Vitals dan UX. Biggest gotchas: analytics double-counting (fix dengan document.prerendering/prerenderingchange), state-changing GET URLs (logout, tambahkan-untuk-cart) Anda harus tidak pernah speculate, dan Chromium-hanya mendukung. Start dengan prefetch broadly; tambahkan prerender untuk one atau two tinggi-confidence halaman di sebagian besar.

What Speculation aturan API actually adalah

Speculation aturan API adalah sebuah browser API — Chromium hanya — itu lets sebuah situs tell browser which sama-situs halaman untuk prepare sebelum sebuah pengunjung clicks. Per MDN, API adalah designed untuk meningkatkan performa untuk future navigations, dan because ini targets document URLs alih-alih individual resource files, ini membuat sense untuk multi-halaman situs rather daripada single-halaman apps. ini supersedes old, deprecated, Chrome-hanya <link rel="prerender"> dan goes beyond widely-available <link rel="prefetch"> dengan sebuah more expressive JSON syntax.

aturan adalah declared sebagai JSON, either inline di sebuah <script type="speculationrules"> block atau via sebuah Speculation-Rules respons header HTTP. mereka dapat list explicit URLs atau auto-match tautan pada halaman via where/href_matches conditions (called document aturan).

ada two speculative tindakan, dan getting distinction right adalah whole game:

  • Prefetch downloads respons body dari referenced halaman — tetapi not -nya subresources. ini pays down next halaman’s TTFB.
  • Prerender fetches, renders, dan memuat halaman ke sebuah invisible di-memory tab: semua subresources, semua JavaScript, bahkan data fetches kicked off oleh JS. Per MDN, future navigations untuk sebuah prerendered halaman adalah near-instant. ini pays down TTFB dan FCP dan LCP — tetapi ini adalah far more expensive dan riskier.

Harry Roberts’ shorthand di his layered-approach write-up captures ini well: prefetch adalah untuk paying down TTFB, prerender adalah untuk LCP.

One di bawah-covered technical nuance: speculated resources land di browser’s memory cache, which adalah quicker untuk retrieve daripada HTTP cache older <link rel="prefetch"> hint menggunakan. dan sebuah prefetched atau prerendered document juga populates HTTP cache, so bahkan sebuah speculation pengunjung tidak pernah menggunakan isn’t pure waste — sebuah later navigation dapat masih benefit.

Eagerness: when untuk speculate, separate dari which URLs

sebuah genuinely clever design choice here adalah itu eagerness adalah sebuah separate lever dari targeting. Barry Pollard’s Chrome blog post pada API’s improvements frames ini sebagai separating when untuk speculate dari which URLs untuk speculate pada. ada four tingkat:

  • immediate — speculate segera setelah aturan adalah seen (pada pemuatan halaman).
  • eager — start pada slightest signal.
  • moderate — roughly sebuah 200ms hover (atau pointerdown pada touch).
  • conservative — pointer- atau touch-down, i.e. pengunjung memiliki semua tetapi clicked.

Treat ini four trigger definitions sebagai Chrome’s saat ini heuristics, not sebuah fixed spec — Chrome memiliki changed exact mobile triggers more daripada once (ini moved moderate untuk viewport-based heuristics dan adjusted eager’s timing sebagai recently sebagai January 2026), so re-periksa live docs sebelum quoting sebuah exact millisecond atau percentage threshold di Anda own implementation notes.

Two related refinements worth knowing: No-Vary-Search lets browser reuse sebuah cached document itu differs hanya oleh ignorable parameters (e.g. UTM-tagged variants dari yang sama halaman), dan newer prerender-until-script pattern (covered oleh CoreWebVitals.io) offers sebuah middle ground antara plain prefetch dan sebuah full prerender — sebagai dari ini writing ini adalah masih sebuah experimental, not-umumnya-available tindakan running di sebuah Chrome origin trial, not sebuah shipped default.

Chrome’s own guardrails

Anda dapat’t accidentally nuke sebuah pengunjung’s device dengan sebuah di atas-broad aturan. Chrome’s prerender documentation sets hard, FIFO caps regardless dari Anda configuration: untuk immediate-eagerness aturan, 50 prefetches dan 10 prerenders; untuk interaction-based (moderate/ conservative) aturan, 2 slots. Chrome juga treats sebuah prerender sebagai sebuah hint dan sebuah progressive enhancement, not sebuah guarantee — ini dapat decline berdasarkan pengguna’s settings atau resource constraints — dan ini won’t render cross-origin iframes pada sebuah prerendered halaman until activation. sebuah dibangun-di privacy guard juga blocks cross-situs prefetches when pengguna sudah memiliki cookies set untuk destination situs.

Cross-origin aturan, dan what actually happens inside sebuah prerendered halaman

Per MDN, prerendering adalah restricted untuk sama-origin documents oleh default. Cross-origin, sama-situs prerendering adalah mungkin, tetapi hanya jika target halaman opts di dengan sebuah Supports-Loading-Mode: credentialed-prerender respons header — cross-situs prerendering isn’t mungkin di semua sebagai dari ini writing. Cross-situs prefetch adalah more permissive (sama-situs dan cross-situs prefetches both berfungsi), tetapi masih gated oleh no-cookies-set privacy aturan above; sebuah broader cross-situs prefetch opt-di via Supports-Loading-Mode adalah documented sebagai planned tetapi not yet shipped.

Inside hidden tab, sebuah prerendering halaman isn’t sebuah normal pemuatan halaman: intrusive APIs (alert()/confirm()/prompt(), requestFullscreen(), Navigator.share()) adalah blocked atau ignored, async APIs like geolocation dan getUserMedia() adalah deferred until activation, dan cross-origin iframes dan worker scripts don’t run until lalu either. Session storage gets special handling worth knowing jika Anda halaman reads ini pada muat: sebuah prerendering halaman starts dengan sebuah clone dari tab’s session storage, dan itu clone adalah discarded di favor dari nyata tab’s storage di activation — so test apa pun session-storage-dependent logic both sebelum dan setelah prerenderingchange event, not hanya pada sebuah normal muat. untuk timing, document.prerendering dan prerenderingchange tell Anda state dan activation moment; PerformanceNavigationTiming.activationStart gives Anda actual elapsed time antara prerender start dan activation jika Anda ingin mengukur ini.

melakukan Speculation aturan API affect SEO, crawling, atau rankings?

ini adalah pertanyaan setiap SEO ingin answered, dan sebagian besar competing artikel wave ini away. precise jawaban memiliki two halves.

What ini melakukan NOT melakukan

ini adalah not sebuah crawling, pengindeksan, atau peringkat mechanism. tidak ada Google Search Central documentation tying Speculation aturan API untuk how Googlebot melakukan crawl atau indeks — because ini doesn’t touch itu layer di semua. ini adalah sebuah browser fitur untuk human pengunjung di Chromium.

closest thing untuk sebuah pada—record Google statement adalah Gary Illyes pada Search Off Record (early 2026), talking tentang resource hints di umum — not Speculation aturan API oleh name. sebagai mesin pencari Journal reported, Illyes’ poin adalah itu Googlebot’s own infrastructure memiliki near-infinite bandwidth dan very fast DNS resolution, so hints like DNS-prefetch dan preload hold essentially no nilai untuk -nya crawling process — ini dapat sudah talk untuk server fast dan doesn’t perlu untuk menjadi told untuk fetch things earlier. Treat itu sebagai mendukung untuk “this is a browser/visitor feature, not a crawler one,” (terjemahan) “ini adalah sebuah browser/pengunjung fitur, not sebuah crawler one,” tetapi note scope: Illyes adalah addressing broader resource-hints family, not Speculation aturan specifically. ini adalah yang sama discipline sibling resource hints piece applies.

juga worth stating plainly because people tanyakan: Bing memiliki published nothing pada Speculation aturan API untuk SEO. Edge (Chromium 109+) mendukung ini sebagai sebuah browser fitur, tetapi there’s no bingbot atau pengindeksan angle — which adalah exactly what Anda’d expect untuk sebuah rendering-browser fitur alih-alih sebuah search-mesin-crawler one.

What ini dapat melakukan

ini dapat meningkatkan Core Web Vitals — terutama LCP, dan indirectly INP oleh front-memuat JavaScript execution sebelum interaction happens — untuk nyata pengguna. Core Web Vitals adalah sebuah documented (jika modest) sinyal peringkat via halaman experience sistem, so there’s sebuah indirect peringkat pathway. tetapi stronger case adalah plain UX dan conversion: membuat next halaman feel instant adalah sebuah nyata business lever independent dari rankings.

non-overclaiming cara untuk frame ini: Speculation aturan won’t get Anda di-crawl atau terindeks differently — ini membuat sebuah halaman feel instant once sebuah nyata pengunjung adalah sudah navigating Anda situs, which adalah sebuah UX dan Core Web Vitals lever, not sebuah crawler one.

dunia nyata hasil

Two proof poin melakukan heavy lifting here, dan both come dari Google’s own publications.

Google Search menggunakan ini pada itself. Per Chrome team’s 2025 announcement, one dari pertama menggunakan dari speculation aturan adalah untuk prefetch pertama two search hasil. diukur gains: pada Android Chrome, LCP untuk clicks dari Google Search adalah reduced oleh 67 milliseconds; pada desktop, sebuah similar 58,6 millisecond LCP improvement. Hover-based prefetching dari remaining hasil cut desktop FCP oleh 7,6 milliseconds dan LCP oleh 9,5 milliseconds. untuk cross-origin hasil prefetches, Google Search routes them melalui Chrome’s private prefetch proxy untuk anonymize permintaan. Very few competing artikel cite itu Google trusts ini enough untuk run ini pada google.com/search di scale — dan published exact millisecond deltas.

Ray-Ban’s case study adalah business-impact proof. Google’s web.dev case study reports itu setelah prerendering product halaman, mobile conversion rates pada PDPs increased oleh 101,47% dan desktop oleh 156,16%, dengan sebuah 43% improvement di LCP pada both desktop dan mobile. Exit rates dropped roughly 13% pada both, dan halaman viewed per session rose 51,95% pada mobile dan 65,30% pada desktop. implementation split adalah instructive: desktop digunakan moderate eagerness triggered oleh hovering product tiles; mobile (no hover state) digunakan immediate eagerness pada hanya pertama four tiles, which adalah paling-clicked.

dan scale adalah sudah besar: WordPress 6.8 (March 2025) ships ini oleh default, membangun pada sebuah fitur plugin itu adalah pada tens dari thousands dari situs sebelum core adoption — meaning sebuah meaningful share dari web sudah memiliki speculation aturan running without anyone configuring them.

cara implement ini safely

consensus adoption order, dari both Google’s docs dan independent experts:

  1. Start dengan prefetch, broadly. Per Chrome’s implementation guide, prefetch adalah relatively safe untuk sebagian besar situs dan adalah initial approach banyak take.
  2. tambahkan prerender narrowly, later. Chrome’s docs warn terhadap di atas-prerendering di sebuah cost dari pengguna resources, dan recommend keeping prerenders down untuk one atau two halaman di sebagian besar. Harry Roberts reaches yang sama conclusion independently — sebuah wildcard-like match adalah too greedy, dan prerendering everything adalah biasanya too expensive dan too risky; sebuah opt-di approach adalah better.
  3. gunakan document aturan untuk scale without per-halaman config. alih-alih hand-listing URLs pada setiap halaman, sebuah where/href_matches condition sources URLs dari document itself so one aturan set dapat apply situs-wide.
  4. Mind Anda CSP. Inline <script type="speculationrules"> blocks perlu explicit allowance di script-src — via 'inline-speculation-rules', sebuah hash-source, atau sebuah nonce-source — atau mereka silently fail when sebuah konten Security Policy adalah di place.

What NOT untuk prefetch atau prerender

Both MDN dan Chrome’s implementation guide adalah explicit itu beberapa URLs harus tidak pernah menjadi speculated, because sebuah speculative fetch adalah masih sebuah nyata permintaan itu dapat trigger nyata side effects. danger list:

  • Sign-out / logout URLs.
  • “Add to cart” (terjemahan) “tambahkan untuk cart” URLs.
  • Language- atau currency-switcher URLs.
  • Sign-di flows itu trigger sebuah SMS/OTP.
  • URLs itu increment sebuah usage allowance atau fire ad-conversion tracking.

root fix adalah sebuah design one: state perubahan — like sebuah /logout tindakan — shouldn’t menjadi plain GET tautan itu sebuah speculation aturan dapat fetch di pertama place.

Prerender adalah stricter masih. Additionally unsafe untuk prerender: halaman itu modify client-side storage pada muat, kirim analytics atau ad-impressions pada muat, atau otherwise cause side effects sebagai jika pengguna memiliki interacted. MDN’s framing adalah itu prerendering adalah riskier daripada prefetching dan seharusnya menjadi done sparingly, hanya where ini adalah worth ini.

Fixing analytics masalah

ini adalah trap itu catches nyata situs. sebuah prerendered halaman fully memuat sebelum pengguna ever sees ini. jika sebuah page_view (atau sebuah ad impression, atau sebuah Meta Pixel event) fires pada muat, Anda’ve logged sebuah visit itu didn’t happen — inflating GA4 sessions dan corrupting attribution.

mechanism untuk fix ini adalah documented di MDN dan Chrome’s guides:

  • document.prerendering adalah true while sebuah halaman adalah menjadi prerendered.
  • prerenderingchange event fires pada activation (when pengguna actually navigates di).
  • server dapat juga detect speculative permintaan via Sec-Purpose permintaan header (prefetch, atau prefetch;prerender).

practical reality: per Chrome’s implementation guide, beberapa analytics providers (Google Analytics) dan ad providers (Google Publisher Tag) sudah mendukung speculation aturan dan won’t log sebuah view until halaman adalah activated. GA4’s own gtag.js handles ini untuk Anda. What typically doesn’t handle ini oleh default: custom GTM tags, Meta Pixel, dan homegrown scripts. untuk tag-manager setups, one clean approach adalah untuk delay tag manager script itself, atau gate spesifik code until halaman adalah activated atau dibuat terlihat. There’s sebuah documented dunia nyata versi dari getting ini wrong — WordPress 6.8 situs reportedly firing GA4 dan Meta Pixel ghost visits setelah fitur auto-enabled; Erwin Hofman covers fix secara mendalam.

browser mendukung reality periksa

ini tempers ROI expectations dan sebagian besar artikel bury ini: Speculation aturan API adalah Chromium-hanya (Chrome dan Edge 109+). ini adalah not Baseline. Firefox memiliki sebuah positive standards position pada prefetch portion hanya dan hasn’t shipped ini; Safari memiliki sebuah implementation behind sebuah flag, off oleh default. sebuah meaningful share dari apa pun situs’s traffic — everyone pada Firefox dan Safari — gets zero benefit, so size Anda expectations accordingly.

Speculation aturan di WordPress 6.8+

Because so much dari search audience adalah pada WordPress dan got ini oleh default: WordPress 6.8 (March 2025) ships dibangun-di Speculative memuat, pada oleh default untuk logged-out pengunjung, menggunakan sebuah conservative, prefetch-hanya configuration out dari box. situs owners dapat customize perilaku — including opting ke prerender untuk key URLs — via wp_speculation_rules_configuration filter (Weston Ruter, sebuah Google engineer dan WordPress core contributor, memiliki sebuah walkthrough). default adalah deliberately safe, which adalah why sebagian besar WordPress situs dapat leave ini pada — tetapi ini adalah juga why analytics gotcha above surprised sebuah lot dari situs owners who tidak pernah chose untuk enable anything.

Myths, debunked

  • “Speculation Rules will help Googlebot crawl my site faster.” (terjemahan) “Speculation aturan akan help Googlebot crawl my situs faster.” No — ini adalah sebuah browser-rendering fitur untuk human pengunjung di Chromium; Googlebot’s own infrastructure doesn’t perlu hints like ini, dan no Google doc tautan API untuk crawling.
  • “It’s the same as <link rel="prefetch">/<link rel="prerender">.” (terjemahan) “ini adalah yang sama sebagai undefined/undefined.” Not quite — ini supersedes deprecated Chrome-hanya rel="prerender", menambahkan sebuah richer JSON syntax (document aturan, eagerness), dan stores speculated resources di memory cache alih-alih HTTP cache.
  • “Prerendering everything makes my whole site instant with no downside.” (terjemahan) “Prerendering everything membuat my whole situs instant dengan no downside.” No — Chrome warns terhadap di atas-prerendering, enforces hard caps, dan both Google dan Harry Roberts recommend di sebagian besar one atau two prerendered halaman.
  • “If I add speculation rules my analytics just works.” (terjemahan) “jika I tambahkan speculation aturan my analytics hanya berfungsi.” hanya jika setiap analytics dan ad script defers via document.prerendering/prerenderingchange. GA4 handles ini; banyak GTM tags dan ketiga-party pixels don’t.
  • “It’s universally supported, so it’s a safe default for all traffic.” (terjemahan) “ini adalah universally didukung, so ini adalah sebuah safe default untuk semua traffic.” No — Chromium-hanya, not Baseline; Firefox dan Safari don’t ship ini oleh default.
  • “Prefetch is risk-free, so I can wildcard it.” (terjemahan) “Prefetch adalah risk-free, so I dapat wildcard ini.” Overstated — sebuah wildcard-like match adalah too greedy, terutama untuk state-changing GET URLs itu seharusnya tidak pernah menjadi fetchable tautan di pertama place.
  • “This will directly move my rankings.” (terjemahan) “ini akan directly move my rankings.” Not established oleh apa pun official source sebagai sebuah direct peringkat factor. credible chain adalah Speculation aturan → better nyata-pengguna Core Web Vitals / conversion → existing, modest halaman-experience signal, plus business wins itu penting regardless dari rankings.

Where ini sits

ini adalah sebuah web performa topic, not sebuah crawling one — dan keeping itu line clean adalah poin. ini adalah sebuah close cousin dari resource hints (preload/preconnect/dns-prefetch/prefetch), which share “browser does network work earlier” (terjemahan) “browser melakukan network berfungsi earlier” idea dan yang sama “doesn’t help Googlebot” (terjemahan) “doesn’t help Googlebot” caveat; ini feeds Core Web Vitals (LCP terutama); dan ini interacts dengan caching dan sebuah CDN since speculated documents populate caches. untuk crawler-side analogue dari “ask before you re-fetch,” (terjemahan) “tanyakan sebelum Anda re-fetch,” conditional-permintaan topic covers how Googlebot menghindari re-downloading unchanged halaman — sebuah berbeda layer (crawler, not browser), sama discipline dari separating mechanics dari peringkat impact.

Add an expert note

Pin an expert quote

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