Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

WordPress Speculative Loading: Test the Cart, Analytics, and Cache Before Prerendering

Illustrated infographic summarizing: WordPress Speculative Loading Needs a Cart, Analytics, and Cache Test

By Greg Nowak. Updated 21 August 2026.

WordPress speculative loading can make the next page feel almost instant. It can also prepare the wrong cart, record a page view nobody made, or send avoidable traffic through an expensive application stack.

That does not make speculative loading a bad idea. It means the release decision belongs to operations, analytics, and commercial teams as well as developers. The useful question is not simply, “Did the page get faster?” It is, “Did it arrive faster while remaining correct, measurable, and affordable to serve?”

Prefetch and prerender are different operational choices

WordPress introduced speculative loading in Core 6.8 with a deliberately restrained default: logged-out visitors on sites with pretty permalinks receive document prefetching with conservative eagerness. In practical terms, the browser starts fetching when someone begins clicking a link. Logged-in users and sites without pretty permalinks are excluded by default.

The official Speculative Loading plugin offers the stronger option many teams are interested in: prerender with moderate eagerness, configurable under Settings > Reading. Prerendering fetches the document, loads its subresources, renders it in a hidden page, and can run JavaScript before the visitor completes the navigation.

That extra head start is why prerendering can produce a bigger improvement. It is also why it needs a broader test pass.

Site or journey Sensible starting point What must be proved before going further
Editorial or brochure site Core’s conservative prefetch Origin load remains acceptable and important links are eligible.
Cached product catalogue Moderate prefetch, then selected prerendering Prices, availability, tracking, and cache behaviour remain correct.
WooCommerce or AJAX cart Conservative prefetch A prerendered cart refreshes after items, discounts, or delivery choices change.
Account or membership area Exclude sensitive paths Login state, permissions, quotas, and personal data are synchronized on activation.
Heavy uncached application Do not increase eagerness yet The origin can absorb unused requests without slowing real visitors.
A practical starting matrix: stronger speculation should follow the economics and statefulness of each journey, not a site-wide enthusiasm for speed.

Audit unsafe URLs before running a speed test

Start by listing URLs that change state through a GET request. Common examples include add-to-cart links, logout links, language switchers, favourites, usage counters, and server-side conversion triggers. Both prefetch and prerender can request these URLs before a completed navigation. State changes should preferably use POST, but inherited themes and plugins do not always follow that rule.

WordPress excludes query-string URLs from its default rule, which catches many traditional action links. Rewritten paths still require attention. Core provides wp_speculation_rules_href_exclude_paths; the official plugin documents the equivalent plsr_speculation_rules_href_exclude_paths filter.

<?php
add_filter(
    'wp_speculation_rules_href_exclude_paths',
    function ( array $paths, string $mode ): array {
        $paths[] = '/cart/*';
        $paths[] = '/checkout/*';

        if ( 'prerender' === $mode ) {
            $paths[] = '/my-account/*';
        }

        return $paths;
    },
    10,
    2
);

Use the no-prerender class when downloading the document early is acceptable but running it is not. Use no-prefetch when the link should be excluded entirely. Apply these controls to the smallest reliable unit: a path pattern for whole journey areas and a class for exceptional links or blocks.

Analytics must wait for a real visitor

A prerendered page can execute JavaScript while hidden. Google Analytics delays during prerendering by default, but that does not automatically validate every tag manager trigger, custom event, affiliate pixel, experimentation tool, consent integration, or CRM conversion script on the site.

Chrome exposes document.prerendering while the page is hidden and fires prerenderingchange when it becomes active. Custom analytics can wait for that transition:

const whenActivated = new Promise((resolve) => {
    if (document.prerendering) {
        document.addEventListener('prerenderingchange', resolve, { once: true });
    } else {
        resolve();
    }
});

whenActivated.then(() => initialiseAnalytics());

After activation, a non-zero performance.getEntriesByType('navigation')[0].activationStart identifies a navigation that was prerendered. Record that signal alongside real-user performance and business events. It lets the team compare speed, page-view accuracy, and conversion behaviour rather than treating all navigations as identical.

Run a cart and personalization test that can actually fail

A normal checkout walkthrough is not enough. The test must create state after the target page has started prerendering:

  1. Open a product or category page and confirm the intended target appears in Chrome DevTools under speculative loads.
  2. Trigger the prerender, then change the cart through AJAX without performing a full navigation.
  3. Activate the prepared cart or checkout page and verify products, quantities, discounts, tax, delivery options, currency, and cart counters.
  4. Repeat for login, logout, saved preferences, membership permissions, and any personalization that can change within the current page.
  5. Check that analytics and conversion events fire once, and only after activation.

If the activated page is stale, refresh its state on activation, cancel and recreate affected speculation rules when state changes, or exclude that journey from prerendering.

Measure cache and server cost alongside Core Web Vitals

Speculation rules are browser hints, not guaranteed work. Browsers can ignore them because of user settings, battery saving, memory pressure, or internal limits. Conversely, a prerender that is never activated may still consume bandwidth, CPU, PHP workers, database queries, third-party API calls, and cache capacity.

Compare origin requests, cache-hit ratios, response time, PHP or application concurrency, and database load before and after the change. Segment cached public pages from uncached or personalized ones. Then compare those costs with activated-prerender rate, LCP, and the business journeys that genuinely became faster.

Roll out by journey, not by switch

Keep Core’s conservative prefetch as the baseline. Exclude unsafe URLs, validate activation-aware analytics, and test state changes before introducing moderate or eager behaviour. Expand first to predictable, cached journeys where the next navigation is likely and the cost of an unused request is low.

If you need an independent test plan, Greg can review the generated rules, map risky journeys, coordinate cart and analytics QA, and turn the findings into a practical release decision. Talk to Greg about a focused WordPress performance review.

Related on GrN.dk

  • Speculative Loading Without Surprises: A CMS Operations Checklist
  • Why Your Website’s Third-Party Stack Needs a Real Owner
  • AI agents need a browser policy before they start clicking around

Need help with this kind of work?

Plan a WordPress performance QA review Get in touch with Greg.

Sources

  • Speculative Loading in WordPress 6.8
  • Speculative Loading WordPress Plugin
  • Prerender Pages in Chrome for Instant Page Navigations
  • MDN Speculation Rules API
Last modified
2026-08-21

Tags

  • wordpress
  • Speculative Loading
  • Performance
  • analytics
  • ecommerce QA

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: Does Your AI Chatbot Clearly Identify Itself?
Does Your AI Chatbot Clearly Identify Itself?
2026-08-25

The EU’s transparency requirements for AI chatbots now apply. Here is how to make your bot’s identity clear, limit its system access and provide a genuine route to a member of staff.

Illustrated infographic summarizing: Should publishers add Google’s new Preferred Sources button?
Should publishers add Google’s new Preferred Sources button?
2026-08-24

Google’s Preferred Sources button is worth a controlled test for eligible publishers, with careful choices around placement, performance and measurement.

Illustrated infographic summarizing: Search Console Can See TikTok Now. Your Reporting Has to Catch Up
Search Console Can See TikTok Now. Your Reporting Has to Catch Up
2026-08-23

Google can now report how social profiles appear in Search. Here is how to measure cross-channel discovery without mistaking visibility for business results.

Illustrated infographic summarizing: Your AI workflow has logs. Can they explain one bad decision?
Your AI workflow has logs. Can they explain one bad decision?
2026-08-22

Logs can show that every service worked while leaving a bad AI decision unexplained. See how connected traces and careful redaction close the gap.

Illustrated infographic summarizing: Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
2026-08-21

NIS 2 is generating more supplier questionnaires. A controlled AI assistant can find approved answers and sources—and route uncertain cases for review.

Illustrated infographic summarizing: Locked out of your Apple developer account? Fix it before October 1
Locked out of your Apple developer account? Fix it before October 1
2026-08-20

Apple's updated developer agreement must be accepted by October 1, 2026, and many small app owners cannot even log in. Here is where Apple's two-factor codes really go, and how to fix your access before the deadline.

Illustrated infographic summarizing: Cloudflare Workflows Now Charges by the Step—Price the Outcome
Cloudflare Workflows Now Charges by the Step—Price the Outcome
2026-08-20

Cloudflare Workflows now bills paid plans for steps and stored state. Here is how to track cost per completed outcome without weakening reliability.

Illustrated infographic summarizing: Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
2026-08-19

Google’s AI Search toggle forces a commercial choice about visibility, attribution and content use. Here’s how to make that choice responsibly.

Illustrated infographic summarizing: From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
2026-08-18

AI can reduce the work involved in processing supplier invoices, but reliable bookkeeping requires validation, duplicate checks, approval and a clear audit trail.

Illustrated infographic summarizing: Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
2026-08-17

Nginx 1.30 defaults upstream proxying to HTTP/1.1 with keepalive enabled. Here is what to inspect, model and test before upgrading.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register