SEO Tools

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.

Quick answer

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.

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.

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.

Related tools

More seo tools

Also try

Also try