How It Works: Caching + AJAX Pricing

June 5, 2026

A plain-English explanation of how Super Speedy AJAX Prices lets you fully cache your shop pages without showing the wrong prices. (For the developer-level internals, see Architecture.)

The conflict: fast pages vs. correct prices

Full-page caching makes a page fast by saving the finished HTML and serving that same copy to everyone — no database, no PHP, just instant HTML.

WooCommerce prices, though, often depend on who’s looking: their country (geolocation), their tax/VAT situation, dynamic-pricing or member discounts, the active currency. A single saved copy of the page can’t be correct for everyone at once.

So stores usually pick one:

  • Cache the pages → fast, but prices can be wrong for some visitors.
  • Don’t cache the pages → always correct, but slow.

This plugin lets you have both.

The trick: show a placeholder, then fill in the real price

Think of it like a printed catalogue with a blank price sticker that gets filled in the moment a specific customer picks it up:

  1. When the page is cached, each price is wrapped in a placeholder. The placeholder still shows the last-known (cached) price, so the page looks complete and the layout doesn’t jump.
  2. When a real visitor opens that cached page, a small script collects every product on the page and asks your server, in one single request, “what’s the correct price for this visitor for all of these products?”
  3. The server replies with prices calculated fresh for that visitor — full geolocation, tax, discounts, currency — and the script swaps them into the placeholders in one smooth step.

The visitor gets a lightning-fast cached page and prices that are correct for them.

Why there’s a brief flash of the old price

Because step 1 shows the cached price and step 3 swaps in the live one, you may notice a price change a fraction of a second after the page loads. That’s the plugin doing its job. It deliberately keeps the cached price visible during the swap (instead of showing “Loading…”) so there’s no blank gap and nothing on the page jumps around.

One request, not one per product

A shop page with 24 products doesn’t make 24 requests — it makes one batched request for all 24. That’s what keeps the approach fast. If new products appear (for example via infinite scroll), only the new ones are fetched, not the whole page again.

Stock can work the same way

The same mechanism can optionally keep stock correct too — “5 in stock”, “Out of stock”, and the Add-to-Cart button — so a sold-out product on a cached page updates to the live state. See Live Stock Refresh.

What you need for it to work

Two things:

  1. A full-page cache that caches your shop/product/category pages (a caching plugin or a CDN/edge cache).
  2. That cache must not cache the plugin’s AJAX request, and must still bypass cart/checkout/account pages.

Set up correctly (see Caching Plugin Configuration), your catalogue is fully cached and every visitor still sees their own correct prices.

In one sentence

Cache the page for speed, then quietly fetch and drop in each visitor’s real prices after it loads — so you never have to choose between fast and correct.

×
1/1