Speculative Loading

Prefetch or prerender pages before the user clicks using the Speculation Rules API.

Last updated Feb 11, 2026

What is speculative loading?

Speculative loading uses the browser's Speculation Rules API to prefetch or prerender pages before the user actually clicks a link. When the user does navigate, the page loads nearly instantly because the browser already has it ready.

This is different from traditional prefetching. The Speculation Rules API lets the browser make smarter decisions about which links to prepare based on user behavior like hovering or scrolling.

Prefetch vs. prerender

BoostPro supports two speculation modes:

ModeWhat happensResource usageSpeed benefit
PrefetchDownloads the HTML document onlyLowModerate
PrerenderFully renders the page in a hidden tab (HTML, CSS, JS, images)HigherNear-instant navigation
  • Default mode: Prerender
  • Recommendation: Use prerender for the best user experience. Switch to prefetch if you're concerned about bandwidth or server load on high-traffic sites

Eagerness levels

Eagerness controls when the browser begins speculating on a link:

EagernessTriggerBest for
ConservativeWhen the user clicks a link (just before navigation)Saving bandwidth, high-traffic sites
ModerateWhen the user hovers over a linkMost sites (good balance of speed and resources)
EagerAs soon as links appear in the viewportContent sites where speed is the top priority
  • Default: Moderate
  • Recommendation: Moderate works well for most sites. It gives users a near-instant experience when they hover over links without wasting resources on links they never click

Automatic exclusions

BoostPro automatically excludes URLs that should never be prerendered:

  • /wp-admin/* and /wp-login.php
  • URLs with query strings
  • WooCommerce cart, checkout, and account pages (detected automatically)

Speculative loading is also skipped entirely for logged-in users, admin pages, AJAX requests, and REST API calls.

Custom exclusions

Add URL patterns to exclude from speculation, one per line:

/members/*
/private/*
/checkout

Use path patterns with wildcards. Each pattern is matched against the URL path.

WordPress 6.8+ compatibility

WordPress 6.8 and later includes built-in speculation rules support. BoostPro detects this and automatically defers to WordPress core when it's available, so there's no conflict or duplicate speculation rules in the page output.

Tip

If you're running WordPress 6.8+, the speculative loading toggle in BoostPro will still appear but won't output duplicate rules. You can manage speculation rules through WordPress core's built-in settings instead.

Browser support

The Speculation Rules API is supported in Chromium-based browsers (Chrome, Edge, Opera) version 109+. Browsers that don't support the API simply ignore the speculation rules with no negative impact on the page.

Best practices

  • Start with moderate eagerness to balance speed and resource usage
  • Exclude dynamic pages like checkout flows, user dashboards, or pages with personalized content
  • Monitor server load if using eager mode with prerender on high-traffic sites, as it increases requests
  • Combine with page caching for maximum impact, since cached pages are served instantly when prerendered