Speculation Rules Generator for Prefetch and Prerender

Generates the speculation rules JSON and script tag for prefetching or prerendering likely next pages.

Use the tool

Why this tool exists

Speculation rules can make the next navigation feel instant, if you pick pages carefully.

The tool writes list rules for exact URLs and document rules with href_matches for patterns, adds exclusions and a selector to skip, and sets eagerness. It splits URLs and patterns into separate rules because a rule cannot have both. Prerender is a Chromium feature; other browsers ignore it.

How to use it

  1. Enter URLs or patterns such as /blog/*, one per line.
  2. Choose prefetch or prerender and the eagerness.
  3. Edit the exclusions.
  4. Paste the script into your page and test in DevTools.

Frequently asked questions

Which eagerness is safest?

moderate or conservative; immediate spends data on every match.

Is prerender risky?

It runs the page without a visit, so avoid pages with side effects and check your analytics.

Do all browsers support it?

Prefetch rules are in the HTML Standard; support differs. Unsupported browsers ignore the script.

Is anything sent?

No.