Performance

Speculative Loading in WordPress: Prefetch/Prerender Settings, Real Benefits, and Real Risks

8 min read
Browser network panel showing speculative prefetch and prerender requests loading ahead of user navigation

WordPress 6.5+ includes native speculative loading support via the Speculation Rules API. This feature lets the browser prefetch or prerender pages before visitors click, making subsequent navigation feel instant. The performance benefit is real—but so are the risks. Understanding both prevents wasting server resources or breaking analytics.

What speculative loading does

When a visitor hovers over or is about to click a link, the browser can begin loading that page in advance. By the time the click happens, the page is already partially or fully loaded. Navigation appears instant because the work was done proactively.

Prefetch downloads the HTML and critical resources for a page without executing them. It’s lightweight—typically a single HTML request plus linked assets. The prefetched resources wait in cache until the user navigates. If they don’t navigate, the resources are discarded.

Prerender goes further: it loads the page and executes it in a hidden tab, including JavaScript execution, rendering, and layout. When the user navigates, the prerendered page swaps in instantly—zero perceptible load time. This creates genuinely instant navigation but uses more resources.

The Speculation Rules API lets you define which pages to speculate and under what conditions (hover, moderate confidence, conservative). WordPress’s implementation uses this API to generate speculation rules automatically based on your configuration.

The real performance benefit

For multi-page WordPress sites where visitors typically navigate between pages, speculative loading dramatically improves perceived navigation speed. Blog readers clicking through articles, documentation users browsing topics, and e-commerce visitors exploring products all benefit from near-instant page transitions.

LCP for subsequent page views drops to near-zero with prerender. The page is already rendered when the user navigates. This doesn’t affect the first page load (no speculation is possible), but every subsequent navigation benefits. For sites where visitors view multiple pages per session, the cumulative experience improvement is substantial.

The benefit concentrates on repeat navigations within a session. First-time visitors landing from search results don’t benefit on their initial page view. The speculative loading benefit grows with pages-per-session. Sites with high engagement (3+ pages per session) see the most benefit.

The real risks

Wasted bandwidth is the most common risk. If speculation predicts wrong—the visitor doesn’t click the prefetched link—the downloaded resources are wasted. On mobile networks with data caps, this wastes visitors’ data. Aggressive speculation on pages with many links can download dozens of pages the visitor never views.

Server load increases proportionally to speculation aggressiveness. Each speculated page is a real request to your server. If your page has 20 links and you prefetch on hover, active visitors might trigger 5-10 prefetch requests per page view—multiplying your server’s request load significantly.

For sites without adequate caching, speculative loading amplifies the problem. Each speculated page generates full dynamic processing if not cached. Origin servers already struggling with traffic see speculation as additional load, not a performance feature.

Analytics accuracy suffers with aggressive speculation. Prerendered pages that the user never visits may trigger analytics page views. Most analytics platforms (including Google Analytics) have mitigations, but edge cases exist. Audit your analytics after enabling speculation to verify accuracy.

Ad impressions on prerendered pages create billing complications. If ads load during prerender but the user never views the page, impressions are counted but never seen. This affects advertising metrics and potentially advertiser relationships.

Safe configuration for WordPress

Start with conservative settings: prefetch only (not prerender), on hover only (not on viewport), and limited to same-origin links. This minimises bandwidth waste and server load while providing meaningful benefit for likely navigations.

Exclude dynamic pages from speculation. Cart pages, checkout, account pages, search results, and paginated archives shouldn’t be speculated because their content varies and caching is complex. Focus speculation on static or semi-static content pages.

Exclude pages with heavy third-party resources from prerender. If a page loads advertising, chat widgets, or social embeds, prerendering it loads all those resources for a page the visitor may never see. Prefetch (not prerender) is safer for resource-heavy pages.

Test with real-user conditions. Enable speculation for a subset of traffic and monitor server load, bandwidth usage, and analytics accuracy. Compare engaged behaviour metrics (pages per session, time on site) between speculative and non-speculative traffic.

Measuring the impact

Track pages-per-session and session duration with and without speculation. Genuine benefit shows in higher engagement because navigation friction decreases. If engagement doesn’t improve, visitors may not be navigating between pages enough for speculation to matter.

Monitor server request volume. Expect an increase proportional to speculation aggressiveness. If your server can’t handle the additional requests, reduce speculation scope or implement better caching before enabling speculation.

Check Core Web Vitals for subsequent page views specifically. Speculation primarily improves subsequent navigations, not initial loads. Segment your CrUX data to see whether speculated pages show better LCP and TTFB for return navigations.

Verify analytics accuracy by comparing server logs with analytics data. If analytics shows significantly more page views than actual navigation, speculation is triggering false page views. Adjust your analytics implementation or speculation settings.

When to enable speculative loading

Sites with high pages-per-session (3+), predominantly static content, adequate server capacity or effective caching, and no heavy advertising benefit most. Blog-heavy WordPress sites are ideal candidates.

Sites with low pages-per-session (most visitors bounce), heavy dynamic content, marginal server capacity, or significant advertising should approach cautiously. The costs may exceed benefits for these patterns.

The practical recommendation: enable prefetch (not prerender) on hover for same-origin content pages. This conservative configuration provides meaningful benefit with minimal risk. Escalate to prerender or more aggressive triggers only after measuring impact and confirming your infrastructure handles the additional load.

Speculative loading is a powerful optimisation for the right sites, but it’s not a universal win. Match the aggressiveness to your site’s engagement patterns and infrastructure capacity. For guidance on balancing speculative loading with your overall performance strategy, we can help evaluate whether your site’s traffic patterns and infrastructure make it a good candidate.

Related insights