WordPress Speculative Loading: How to Test Your Cart, Analytics and Cache

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

By Greg Nowak. Last updated 2026-12-02.

Choose a product page with a basket total in the header. Let the browser prepare that page, then add an item to the basket before opening it. Which total does the shopper see? That sequence tells you more about whether your shop is ready for WordPress prerendering than a fast click through an empty store.

I’d start with one common journey, such as a product category leading to a bestseller. It gives the agency a specific link to speed up, marketing a page view to verify, and the host a pair of URLs to watch. Here’s how to decide whether to roll it out.

Check what a logged-out visitor actually gets

Prefetch lets the browser fetch the next page’s HTML early. Prerender also lets it build that page and run JavaScript in the background. Core WordPress defaults to conservative prefetching for logged-out visitors on sites with pretty permalinks. Since WordPress 7.1, a host can override both the mode and how early loading starts. WordPress Core defaults and hosting overrides.

The WordPress Performance Team’s Speculative Loading plugin defaults to moderate prerendering, which can start when someone hovers over a link. Its controls are under Settings > Reading. Open the public category page while logged out and inspect Application > Speculative loads in Chrome DevTools. Check which rule applies to your product link, including any supplied by a performance plugin or CDN. Testing only in your administrator session can hide the behaviour shoppers get. Speculative Loading plugin settings.

Choose which links the browser can prepare

Destination Starting choice What to check
Article or service page Keep conservative prefetch Does the next page appear sooner on a typical visit?
Cached product page Trial prerendering on selected links Do the price and basket total reflect this shopper’s session?
Cart, checkout or account Exclude from the trial Does each customer receive their own current details?
Add-to-cart or logout link Exclude from both modes Could fetching the URL alone change the session?
Suggested scope for a first rollout. A public product page can still contain a personalised basket.

Check any link that performs an action on a GET request. Even a prefetch reaches the server. Core skips query-string links when pretty permalinks are enabled, but a custom path can perform the same action. Move state changes to POST where practical. In a site plugin, your developer can add exclusions to the Core rule like this:

add_filter( 'wp_speculation_rules_href_exclude_paths', function ( $paths ) {
    foreach ( array( '/cart', '/checkout', '/my-account' ) as $path ) {
        $paths[] = $path;
        $paths[] = $path . '/*';
    }
    return $paths;
} );

Use the shop’s actual paths, including translated slugs. The example covers each bare path, its trailing slash and its subpages. For an individual link or block, Core recognises no-prefetch to exclude both modes and no-prerender to exclude prerendering. Verify that any additional rules respect those exclusions. WordPress rule matching and exclusions.

Change the cart between preparation and navigation

  1. On the category page, hover over the selected product link. In DevTools, confirm the product URL shows a ready prerender.
  2. Stay on the category page. Use its quick-add button or mini-cart to change the quantity without reloading. Note the new quantity and total.
  3. Open the prepared product link. Compare its basket with the figures you just recorded, then open the cart and check the line items. Check in DevTools whether the browser used the prepared page or fetched a fresh one.

If the old total appears only on a prerendered visit, keep that product link excluded while the developer refreshes basket data on activation. If ordinary visits also show the wrong total, check the page cache and CDN. WooCommerce recommends excluding Cart, Checkout and My Account from page caching. Test with two separate browser profiles holding different baskets to verify that each receives its own contents. WooCommerce cache guidance.

Count the visit when the shopper opens the page

Run the hover test twice with analytics consent granted. First, leave the product unopened and check your analytics debugger for an unexpected product view. Then hover and click. That visit should produce one product view. Google Analytics waits for activation by default, but custom tags and affiliate pixels need their own checks. For custom tracking, put the existing consent-aware initialiser behind the activation event:

if (document.prerendering) {
    document.addEventListener('prerenderingchange', initialiseAnalytics, { once: true });
} else {
    initialiseAnalytics();
}

Use this in place of the existing startup call so the integration starts once. Repeat with consent declined and verify that tags requiring consent stay silent. A positive navigation timing activationStart identifies an activated prerender when you review real visits. Chrome’s prerender and analytics guidance.

Decide whether the speed gain pays for the requests

Compare the trial with ordinary visits on the same category-to-product journey. Look at how long shoppers wait after clicking for the main product content to appear. Ask the host for origin requests per visit, cache hits and PHP worker load over comparable traffic periods. An unopened product can still cost a database query or a stock lookup. If the gain is small or checkout slows under load, restore the previous rule and keep the narrower scope.

If your agency manages WordPress, marketing owns the tags and a hosting partner controls the cache, I can bring those checks together and help you decide which links to enable. Talk to Greg about your WordPress rollout.

Related on GrN.dk

Need help with this kind of work?

Discuss your WordPress prerendering rollout with Greg Get in touch with Greg.

Sources

Latest articles

Before WooCommerce 11.4 arrives, test your gift guide on a store copy. Choosing Medium should narrow the knitwear grid and leave the sale gifts below it alone.

AI can read the bank account number on a PDF invoice. If it differs from the supplier’s approved account, accounts payable puts the payment on hold and calls the supplier.

Let’s Encrypt moves to 64-day certificates on 10 February 2027. Check when each site renews, test the reload and verify the certificate visitors receive.

Work out which Drupal 10 sites can move to Drupal 11 by 9 December, who can resolve each blocker and how to test publishing and rollback before launch.

See how SharePoint access changes reach internal AI search, and test how long revoked content can still appear in results, generated answers, and citations.

At month-end, reconcile Shopify Payments against your bank statement and e-conomic. Use the payout ID to trace fees, refunds, and payouts that reach your bank the following month.

Trace an intermittent NGINX 502 through Cloudflare, upstream attempts, and application logs so you can see where the request failed and who should pick it up.

Find the apps, scripts and printers that still send mail through Microsoft 365 with a mailbox password, then test a replacement before the December 2026 change.

Find subscriptions and insurance expenses in e-conomic that should be spread over several months. See how AI reads the supporting documents and how your finance lead approves the proposed allocations.

Before relying on an AI project briefing, check which files it covered. A practical workflow for tracking documents, recording gaps and verifying key claims.