SEO Tools

Free Speculation Rules Generator

Choose prerender or prefetch mode, pick a URL list or document rules source, and get the script tag with JSON speculation rules. Use to speed up navigation on static sites.

Loading tool...

What is Speculation Rules Generator?

Speculation Rules are a JSON-based browser feature that lets you tell the browser which pages to prefetch or prerender before the user clicks. Prerendering loads the full page for instant navigation, while prefetching fetches only the document resource. This can make a static site feel fast because subsequent page views load from cache or pre-rendered state.

quickAnswer

Speculation Rules use JSON to tell Chrome and Edge which pages to prefetch or prerender before the user clicks. Prerender loads the full page for instant navigation; prefetch fetches only the main document.

Last updated: 2026-06-11

limitations

  • Speculation Rules only work in Chrome and Edge. Other browsers ignore the script tag entirely.
  • Eager prerendering of many pages can waste significant bandwidth and memory, especially on mobile devices.
  • Cross-origin prerendering has strict privacy constraints. Browsers may strip cookies and storage access from cross-origin prerendered pages.

Sources:MDN Web Docs · W3C Specifications · jquery.app on GitHub

How to use this tool

  1. Choose whether to prerender pages (full render) or prefetch them (document fetch only).
  2. Select the URL list source to specify exact pages, or document rules for pattern-based matching.
  3. Set the eagerness level. Conservative fires on hover or focus, moderate adds a short delay, eager fires immediately.
  4. Copy the script tag into your page head or near the end of body.

What you can use it for

  • Prerender top navigation pages so they open instantly when clicked.
  • Prefetch blog article pages from a listing to speed up reading flow.
  • Add speculation rules to a documentation site so section pages load faster.

Use cases

Practical examples

example

Prerender main navigation

A site prerenders the About, Tools, and FAQ pages because most visitors navigate to them from the homepage. Eagerness is set to moderate to balance speed and bandwidth.

example

Document rules for blog links

A blog listing uses document rules so any same-origin link on the page is eligible for prefetching when the user hovers over it.

Common mistakes

  • Prerendering too many pages, which wastes bandwidth and browser resources.
  • Setting eagerness to eager on every page, which can cause excessive prefetching.
  • Prerendering cross-origin pages without understanding the privacy and cookie implications.

verification

  1. Open Chrome DevTools, go to Application > Speculation Rules to verify the rules are parsed correctly.
  2. In the Network panel, check that prerendered or prefetched pages show the Proxied or Prefetched status in the Size column.

FAQ

Questions about Speculation Rules Generator

Which browsers support Speculation Rules?

Chrome 109+ and Edge 109+. Other browsers ignore the script tag, so it is safe to include as a progressive enhancement.

What is the difference between prerender and prefetch?

Prerender fetches and fully renders the page including subresources, making navigation feel instant. Prefetch fetches only the main document, which is lighter on bandwidth.

Should I prerender cross-origin pages?

Cross-origin prerendering is limited. Browsers may not send cookies or storage state to cross-origin prerendered pages, and same-origin prerequisites apply. Prefetch is generally safer for cross-origin URLs.

Does prerendering affect analytics pageview counts?

Yes, and this is a known issue. A prerendered page fires analytics scripts and counts a pageview even if the user never navigates to the page. To handle this, use the document.prerendering API or the activationStart performance entry to defer analytics until the page is actually activated by user navigation. Without this guard, your analytics will overcount pageviews for prerendered pages.

Related tools

More seo tools

Seo

AI Crawler robots.txt Builder

Build a robots.txt policy for AI crawlers. Choose from open, selective, or strict presets and block specific AI training bots while allowing search engines.

Open tool

Also try

Also try

Html

ARIA Live Region Generator

Generate accessible ARIA live region HTML snippets with role, aria-live, aria-atomic, and aria-relevant attributes. Includes optional JavaScript update function.

Open tool

Html

CSP Hash Generator

Generate CSP hash values for inline scripts and styles. Hash exact code content with SHA-256, SHA-384, or SHA-512 and get the matching CSP directive snippet.

Open tool