Skip to content
Get your free SEO report→
Back to blogTechnical

Speculation Rules API: Instant LCP and Crawl Safety

Prerender pages with the Speculation Rules API for sub-100ms LCP. Learn how speculative prerendering affects Core Web Vitals, search bots, and server load.

Piyush Rathod avatarPiyush Rathod11 min readUpdated September 29, 2026
Share:
On this page

The Speculation Rules API allows web browsers to prefetch and prerender upcoming navigations in background processes before a user clicks. When configured properly, this drops Largest Contentful Paint (LCP) from several seconds down to under 100 milliseconds, turning multi-page sites into instant, app-like experiences. For technical SEOs managing competitive sites, this is the most direct lever available for lifting real-user Core Web Vitals into the green band.

However, speculative loading introduces architectural tradeoffs that search teams cannot afford to ignore. Prerendering full documents consumes server memory, database connections, and bandwidth. If your speculation rules fire too aggressively on uncacheable URLs, you risk saturating your origin server, triggering HTTP 503 errors, and indirectly depressing Googlebot’s crawl rate.

Understanding how to balance instant page delivery against origin infrastructure and search engine crawl patterns is essential for running modern technical performance at scale.

Key takeaways

  • Speculation rules enable true background prerendering. Unlike legacy prefetching which only downloads raw HTML, the Speculation Rules API can initialize the rendering engine, execute scripts, and build the DOM in memory for instant activation.
  • Googlebot does not execute speculation rules. Search crawlers and AI bots fetch HTML linearly and ignore speculative execution rules. Your internal link discovery remains dependent on standard HTML anchor tags.
  • Field LCP in CrUX drops toward zero. While lab audits like standard Lighthouse runs do not trigger speculative rules, real-user data recorded by the Chrome User Experience Report (CrUX) registers sub-100ms LCP on prerendered visits, directly lifting ranking signals.
  • Uncontrolled prerendering endangers crawl capacity. Prerendering dynamic or query-heavy URLs creates unnecessary server load. If server response times spike or return gateway errors, search engine crawl schedulers automatically throttle request rates.
  • Analytics require explicit guards. Firing tracking tags inside a background prerender before a visitor actually visits the page corrupts session counts, conversion rates, and bounce metrics.

What is the Speculation Rules API?

The Speculation Rules API is a modern browser standard designed to replace older declarative hints such as <link rel="prefetch"> and <link rel="prerender">. Instead of placing individual link tags in the document head, you define a structured JSON configuration inside an inline script block.

The browser evaluates these rules to decide whether to fetch resources (prefetch) or fully render documents in an isolated, invisible background tab (prerender).

<script type="speculationrules">
  {
    "prerender": [
      {
        "source": "document",
        "where": {
          "and": [{ "href_matches": "/products/*" }, { "not": { "href_matches": "/*\\?*" } }]
        },
        "eagerness": "moderate"
      }
    ]
  }
</script>

The API supports two primary modes of rule declaration:

  1. List rules: An explicit array of URLs to prefetch or prerender ("source": "list").
  2. Document rules: Pattern-matching criteria where the browser inspects links already present in the DOM ("source": "document") and speculates based on link patterns, CSS selectors, or viewport visibility.

The API also introduces granular control over execution timing through the eagerness property:

  • immediate: Fires as soon as the speculation rule is parsed in the HTML.
  • eager: Fires as soon as system resources permit, regardless of user interaction.
  • moderate: Fires when a user hovers over a link for 200ms or begins pointer-down events.
  • conservative: Fires only when a user presses down on a link or initiates a tap gesture.

For years, developers attempted speculative navigation using <link rel="prerender">. In practice, browser support was inconsistent, memory management was opaque, and sites often wasted significant data pre-executing pages that users never navigated to.

The Speculation Rules API rearchitects this pipeline with strict resource limits and security boundaries.

Feature Legacy <link rel="prerender"> Speculation Rules API
Execution model Often downgraded to simple prefetch Full DOM construction and script execution
Configuration Single HTML tag per URL Centralized JSON rules supporting regex matching
Eagerness control Binary (always attempted immediately) Four tiers: immediate, eager, moderate, conservative
Resource constraints Uncontrolled memory consumption Automatic cancellation on low memory or CPU constraints
Cross-origin support Severely restricted by security policies Safe credentialed cross-origin prerendering via Opt-In
Cancellation Difficult to interrupt cleanly Automatically aborted on user departure or device stress

How browsers and search engines process speculative navigations

To understand the SEO implications, examine how human user journeys differ from crawler visits when speculation rules are active:

User Navigation Flow:
[User views page] ──> [Hovers over link 200ms] ──> [Browser sends Sec-Purpose: prerender]
                             │
                             ▼
               [Origin / CDN returns cached HTML]
                             │
                             ▼
               [Browser builds DOM in background]
                             │
[User clicks link] ──> [Instant Activation: LCP < 100ms]

Googlebot Crawl Flow:
[Crawler requests URL] ──> [Parses raw HTML] ──> [Extracts <a href="...">]
                                │
                                ▼
               [Ignores <script type="speculationrules">]
                                │
                                ▼
               [Queues discovered links in crawl scheduler]

When a human visits a page with moderate prerendering enabled, hovering over a navigation link triggers a background HTTP GET request. The browser passes the header Sec-Purpose: prefetch;prerender.

If the server responds with a 200 status code, the browser launches an isolated rendering pipeline. Scripts execute, CSS renders, and the layout tree forms. When the user completes the click, the active document swaps instantly with the prerendered document. The user experiences zero network wait time.

Search engine crawlers, such as Googlebot, Bingbot, and AI retrieval agents, process pages differently. They download the initial HTML payload and parse the DOM structure. Because crawlers do not have physical viewports or pointer interactions, they do not simulate hover states or execute navigation speculation.

Does Googlebot execute speculative prerendering?

Short answer: No. Googlebot does not execute speculation rules.

Google’s Web Rendering Service (WRS) runs a headless Chromium environment to discover links, render content, and process structured data. However, Googlebot’s crawler pipeline intentionally disables speculative features to prevent infinite crawl loops and unnecessary bandwidth consumption.

This architectural difference creates one critical rule for technical SEO:

Never rely on speculation rules for link discovery.

If internal links exist solely inside a "source": "list" array within a speculation rules script and do not appear as standard <a href="..."> anchor tags in the DOM, Googlebot will not queue or crawl those URLs. Search engines discover the web graph through accessible HTML anchor tags with valid href attributes. Speculation rules are a performance enhancement for real users, not a replacement for internal linking.

For a deeper dive into how search crawlers process links and manage crawl depth, consult our guide on crawl budget for large sites.

How prerendering lifts real-user Core Web Vitals in CrUX

Google uses the Chrome User Experience Report (CrUX) to assess whether a site passes Core Web Vitals thresholds for search ranking. CrUX gathers anonymized performance metrics from real Chrome users browsing the web under real-world network conditions.

The ranking algorithm looks at the 75th percentile of user visits across three core metrics:

  1. Largest Contentful Paint (LCP): Must occur within 2.5 seconds.
  2. Interaction to Next Paint (INP): Must remain under 200 milliseconds.
  3. Cumulative Layout Shift (CLS): Must score below 0.1.

On traditional multi-page websites, even heavily optimized server responses face network latency, TLS negotiation, and DOM construction time. Achieving an LCP below 1.2 seconds on mobile cellular networks is challenging.

When a page activates from a prerendered state, the Largest Contentful Paint candidate is already painted and rendered in memory before the navigation begins. The recorded LCP metric for that visit frequently measures between 50ms and 90ms.

Because CrUX aggregates real-world Chrome page loads, prerendered navigations contribute their near-zero LCP readings directly into your site’s 75th percentile calculation. For sites hovering in the amber zone (between 2.5s and 3.5s LCP), deploying moderate prerendering on primary user paths can pull the aggregate score into the green band, satisfying Google’s page experience ranking criteria.

To audit your current page load baseline and identify heavy assets before prerendering, run the SEO Analyzer on your key templates.

The 4 infrastructure and crawl risks to avoid

While the user experience benefits are substantial, deploying speculation rules without technical safeguards introduces risks that can hurt organic performance.

1. Origin server overload and crawl rate throttling

Prerendering consumes real server resources. If a visitor scrolls through a blog category page containing 20 links, and your speculation rules use eagerness: "immediate" or eagerness: "eager", the browser might trigger 20 parallel requests to your backend.

If hundreds of concurrent visitors browse your site, this multiplies origin request volume. If your server CPU spikes or backend databases become saturated, Time to First Byte (TTFB) degrades across the entire site.

When Googlebot detects rising TTFB or encounters HTTP 503 (Service Unavailable) responses, its adaptive crawl algorithm immediately throttles the crawl rate to prevent crashing your server. To prevent this:

  • Use eagerness: "moderate" or eagerness: "conservative" for prerendering rules.
  • Restrict prerendering to static or edge-cached routes that do not trigger expensive database queries.
  • Exclude search filters, pagination strings, and faceted navigation parameters.

2. Analytics inflation and ghost conversions

A critical flaw in naive prerendering implementations is triggering analytics pageviews before a user actually views the page.

If a browser prerenders five articles while a user reads a single post, and your analytics script fires on initial script execution, your tracking platform records five pageviews instead of one. This artificially deflates bounce rates, skews conversion funnels, and distorts engagement metrics.

Modern analytics tags must check the document.prerendering state before dispatching hits:

function trackPageView() {
  // Check if document is currently prerendering in the background
  if (document.prerendering) {
    document.addEventListener(
      'prerenderingchange',
      () => {
        // Fires only when the user actually activates and views the page
        sendAnalyticsEvent('page_view');
      },
      { once: true },
    );
  } else {
    // Normal immediate navigation
    sendAnalyticsEvent('page_view');
  }
}

Most modern tag managers handle this automatically, but custom tracking libraries and event listeners must be reviewed to ensure they respect the prerenderingchange lifecycle event.

3. State mutations and user session side effects

HTTP specifications state that GET requests should be safe and idempotent. However, legacy web applications sometimes trigger state changes on GET requests—such as logging a user out, adding an item to a shopping cart via a query parameter, or rotating a security token.

Prerendering a URL that alters session state will execute those mutations in the background without the user’s intent. Always write strict negative rules to exclude sensitive routes:

{
  "not": {
    "href_matches": ["/cart/*", "/checkout/*", "/account/*", "/auth/*", "*/logout"]
  }
}

4. Bypassing edge cache layers

If your origin server does not configure proper caching headers, speculative requests will bypass intermediate caches and hit your database directly.

Inspect the incoming Sec-Purpose header on your reverse proxy or CDN edge. When a request arrives with Sec-Purpose: prefetch;prerender, ensure your cache policy returns the cached response if available. Pair this with stale-while-revalidate HTTP directives so that background prerenders refresh stale caches without blocking client delivery.

Step-by-step implementation workflow

Follow this technical workflow to implement speculation rules safely across an editorial or commercial website:

Step 1: Define safe target URL patterns

Audit your URL taxonomy. Identify high-intent navigation paths that represent safe, read-only content:

  • Homepage to primary category hubs
  • Category hubs to featured articles or top products
  • Article bodies to the next logical guide in a sequence

Exclude all URLs containing query parameters, administrative paths, user profiles, and transactional flows.

Step 2: Select the appropriate eagerness tier

Match your eagerness setting to your server capacity:

  • Eager / Immediate: Reserve strictly for single, deterministic next steps (such as a multi-step onboarding wizard where 95% of users proceed to step two).
  • Moderate (Hover): The recommended default for editorial and product sites. Waiting for a 200ms pointer hover eliminates 70% of accidental speculative triggers while preserving near-instant feel.
  • Conservative (Touch/Click): Ideal for mobile-heavy sites or origins with limited compute headroom. Prerendering starts the instant the finger touches the screen, shaving 100ms to 200ms off mobile navigation.

Step 3: Implement the document rule snippet

Add the speculation rules script to your shared page layout. Place it toward the end of the <body> to ensure the primary HTML parser finishes processing critical assets first:

<script type="speculationrules">
  {
    "prerender": [
      {
        "source": "document",
        "where": {
          "and": [
            { "href_matches": "/*" },
            {
              "not": {
                "href_matches": ["/api/*", "/search*", "/*\\?*", "*.pdf"]
              }
            },
            {
              "not": {
                "selector_matches": "[rel~=nofollow], .no-prerender"
              }
            }
          ]
        },
        "eagerness": "moderate"
      }
    ]
  }
</script>

Notice the selector match filter: { "selector_matches": "[rel~=nofollow], .no-prerender" }. This prevents the browser from speculatively prerendering sponsored links, untrusted external references, or links you have explicitly marked to ignore.

Step 4: Verify in Chrome DevTools

To verify your configuration in production:

  1. Open Chrome DevTools and navigate to the Application panel.
  2. In the left sidebar under Background Services, click Speculative Loads.
  3. Under the Rules tab, verify that your JSON was parsed without syntax errors.
  4. Hover over a qualified internal link on your page.
  5. In the Speculations tab, confirm that the target URL status transitions from Ready to Success.
  6. Click the link and verify that the page status changes to Activated.

Frequently asked questions

Will using the Speculation Rules API improve organic search rankings?

Yes, indirectly through Core Web Vitals improvements. Google uses real-user CrUX data as a page experience ranking factor. By prerendering subsequent page views, your field LCP drops significantly, helping pages achieve green scores across real-world visits.

Does prerendering waste mobile user data?

The Speculation Rules API includes built-in safeguards to protect mobile users. Browsers automatically disable speculative prefetching and prerendering if a user enables Data Saver mode or connects through a cellular network with a metered connection flag.

Can I prerender pages from an external domain?

Yes, cross-site prerendering is supported under the W3C specification, but it requires the target domain to opt in by returning the Supports-Loading-Mode: credentialed-prerender HTTP response header. Without this header, the browser will refuse to prerender cross-origin documents.

How does the Speculation Rules API interact with INP?

While speculation rules primarily target LCP by pre-painting the next document, they also improve Interaction to Next Paint (INP). By completing script evaluation and hydration during the idle background phase, the page is ready to respond immediately to user clicks upon activation. For guidance on optimizing hydration bottlenecks, review our INP fix guide.

The bottom line

The Speculation Rules API bridges the performance gap between static sites and complex web applications. By allowing browsers to build documents in memory before navigation, you eliminate the network and rendering delays that frustrate users and degrade Core Web Vitals.

For technical SEOs, success depends on architectural discipline. Keep your link graph accessible through standard HTML anchor tags, protect your origin server with conservative eagerness settings, and ensure your analytics tags respect the prerendering lifecycle. Done right, you unlock instant page transitions for humans while keeping your site stable, crawlable, and fully visible to search engines.

Run the 45-Point SEO Analyzer

Run 45-Point SEO Analyzer on your site — instant score. No signup, no server calls.

Stay updated on SEO changes

We send out a quarterly digest of search volatility and algorithm updates. No spam, ever.

Enter your email to subscribe to the quarterly SEO digest

Know someone who'd find this useful?

FAQ

Frequently asked questions

The questions readers ask before they put the playbook to work.

Yes, indirectly through Core Web Vitals improvements. Google uses real-user CrUX data as a page experience ranking factor. By prerendering subsequent page views, your field LCP drops significantly, helping pages achieve green scores across real-world visits.
The Speculation Rules API includes built-in safeguards to protect mobile users. Browsers automatically disable speculative prefetching and prerendering if a user enables Data Saver mode or connects through a cellular network with a metered connection flag.
Yes, cross-site prerendering is supported under the W3C specification, but it requires the target domain to opt in by returning the Supports-Loading-Mode: credentialed-prerender HTTP response header. Without this header, the browser will refuse to prerender cross-origin documents.
While speculation rules primarily target LCP by pre-painting the next document, they also improve Interaction to Next Paint (INP). By completing script evaluation and hydration during the idle background phase, the page is ready to respond immediately to user clicks upon activation. For guidance on optimizing hydration bottlenecks, review our INP fix guide.