← Back to Blog

Speculation Rules will make your site feel instant if you set them up right

Speculation Rules will make your site feel instant if you set them up right

The Speculation Rules API is one of the most impactful performance features Chrome has shipped in years, and almost nobody is using it correctly. It lets you tell the browser to prerender or prefetch specific pages before the user clicks on them. When the user does click, the page appears instantly because it was already loaded in the background.

This is not prefetching a few resources. This is rendering the entire page, running the JavaScript, executing the layout. The user sees a fully rendered page in under 100 milliseconds. It feels like a native app.

How it works

You add a <script type="speculationrules"> block to your page with a JSON object that specifies which URLs to prerender and under what conditions. The browser reads these rules and begins loading the specified pages in the background.

There are two actions: prefetch (download the HTML and subresources) and prerender (download, parse, render, and execute JavaScript). Prerender is the one that makes pages feel instant. Prefetch is a lighter touch that still helps.

The eagerness setting controls when the browser starts speculating. "immediate" starts as soon as the page loads. "eager" starts quickly but with some browser discretion. "moderate" waits for user interaction signals like hovering over a link. "conservative" only triggers on actual click or touch.

What goes wrong

Prerendering too many pages. If you set eagerness to "immediate" and prerender every link on the page, you are rendering 20 or 30 pages the user will never visit. That wastes bandwidth, battery, and server resources. It also means your analytics will count prerendered page views that never actually happened.

Prerendering pages with side effects. If a prerendered page triggers a purchase, submits a form, or calls an API that changes state, those side effects fire before the user intended them. Pages with mutations should not be prerendered.

Missing source patterns. The API supports URL list rules and document rules (pattern-based matching). Using URL lists means hardcoding every target. Document rules with href matching are more maintainable but the pattern syntax needs to be correct or nothing matches.

No fallback for unsupported browsers. Speculation Rules are Chrome-only as of mid-2026. Firefox and Safari have not shipped support. If your navigation experience depends on prerendering, unsupported browsers need a graceful path.

What the audit checks

The Speculation Rules API Audit parses any speculation rules blocks on your page and validates:

Whether the JSON is syntactically correct. Whether the eagerness level is appropriate for the number of targets. Whether prerender targets include pages that should not be prerendered (forms, checkout, API endpoints). Whether the source patterns will actually match the links on the page. Whether there is a mix of prefetch and prerender for different URL types.

It catches the configuration mistakes before your users hit them.

The performance payoff

On sites where speculation rules are set up correctly, navigation between pages drops from 1 to 3 seconds down to under 100 milliseconds. For content-heavy sites where users read one article and click to the next, this changes the entire user experience. Bounce rate drops because the next page appears before the user has time to reconsider.

For sites built on static generators (Eleventy, Next.js static export, Hugo), speculation rules are particularly effective because every page is a static HTML file with predictable content. There are no server-side side effects to worry about.

If you are building fast, lightweight sites on a shoestring, which is what The $97 Launch is about, speculation rules are free performance. No server changes, no infrastructure costs. Just a JSON block that tells the browser what is coming next.

Fact-check notes and sources

  • Speculation Rules API shipped in Chrome 109 (January 2023) for prefetch, Chrome 121 (January 2024) for document rules. Source: Chrome Platform Status.
  • Prerendered pages render in under 100ms on subsequent navigation. Source: web.dev/articles/speculative-loading.
  • Firefox and Safari have not shipped Speculation Rules support as of May 2025. Source: caniuse.com.
  • Google Analytics 4 automatically deduplicates prerendered page views using the Speculation Rules integration. Source: Google developers documentation on prerendering.

Related reading

This post is informational, not web development consulting advice. Mentions of Chrome, Google, Firefox, and Safari are nominative fair use. No affiliation is implied.

← Back to Blog

Accessibility Options

Text Size
High Contrast
Reduce Motion
Reading Guide
Link Highlighting
Accessibility Statement

J.A. Watte is committed to ensuring digital accessibility for people with disabilities. This site conforms to WCAG 2.1 and 2.2 Level AA guidelines.

Measures Taken

  • Semantic HTML with proper heading hierarchy
  • ARIA labels and roles for interactive components
  • Color contrast ratios meeting WCAG AA (4.5:1)
  • Full keyboard navigation support
  • Skip navigation link
  • Visible focus indicators (3:1 contrast)
  • 44px minimum touch/click targets
  • Dark/light theme with system preference detection
  • Responsive design for all devices
  • Reduced motion support (CSS + toggle)
  • Text size customization (14px–20px)
  • Print stylesheet

Feedback

Contact: jwatte.com/contact

Full Accessibility StatementPrivacy Policy

Last updated: April 2026