Black Friday: 50% off every paid plan. Lifetime from $79.

Grab 50% Off Grab it →
Get Plugin xSpeed Hub
xSpeed Hub Pricing Docs Blog Scan
Appearance
Get Plugin
All articles
WooCommerceTutorialCachingCheckoutWordPress

Best xSpeed Cache Settings for WooCommerce (Without Breaking Checkout)

Abdur Rahman Emon 11 min read
Best xSpeed Cache settings for WooCommerce: page cache on, 24-hour cache expiry, checkout-safe Delay JS on, combine files off

A WooCommerce store is two sites in one. The shop, product and category pages are the same for every visitor and can be cached like a blog. The cart, checkout and account pages are personal and must never be. Most speed advice for stores goes wrong at the boundary: a JavaScript setting that’s harmless on a product page stops a payment button working on the checkout.

This guide sets up xSpeed Cache on a store in the order that keeps checkout safe. Every step ends with a check. The full value table is at the end, and the same values sit next to a blog’s on Recommended settings. Everything here works on the free plugin unless it says Pro.

Step 0: Measure before you change anything

Run a speed test on four pages and write the numbers down: the home page, the shop, one product, and the checkout with something in the cart. Note TTFB and LCP for each. Do it twice and keep the second run, because the first warms things up.

Also check one setting in WooCommerce before you start: WooCommerce › Settings › General › Default customer location. It decides whether your prices can be cached at all:

  • Shop base address or No location by default: everyone sees the same prices. Page caching works normally. Pick this if your prices and taxes don’t change by country.
  • Geolocate: don’t combine this with any page cache. The first visitor’s prices get stored and shown to everyone.
  • Geolocate (with page caching support): WooCommerce adds a ?v= code to addresses to keep countries apart. xSpeed doesn’t cache those addresses yet, so most of the store goes uncached. Use it only if you really need prices by location.

Step 1: Page cache, browser cache and GZIP

Run the setup wizard on Balanced. It turns on the page cache, browser cache, GZIP, Minify HTML and CSS, and image lazy-loading, and it leaves JavaScript alone. On nginx, paste the server snippet the wizard shows, so cached pages are served without starting PHP.

You don’t need to add anything for the cart and checkout. Out of the box, xSpeed never stores:

  • cart, checkout and account pages, whatever you’ve called them. WooCommerce marks those pages “do not cache” by page, and xSpeed respects that, so a translated or renamed checkout is safe.
  • any visitor with something in their cart. WooCommerce’s cart and session cookies are on xSpeed’s default excluded-cookie list, so those shoppers get freshly built pages.
  • WooCommerce’s API and AJAX requests.

The Page Cache docs list all 17 default URL patterns and 20 cookies. Add to them only for a checkout WooCommerce doesn’t know about (a funnel or one-page checkout built with another plugin), or for a currency switcher’s cookie if prices change with it.

Check: open a product in a private window and reload it. The X-XSpeed-Cache response header should say HIT. Add the product to the cart and reload: you should now get a freshly built page, with the right mini-cart count.

Step 2: Set the cache expiry to 24 hours

You don’t need a short expiry to keep prices right. xSpeed clears a product’s pages automatically whenever its price, stock or stock status changes. That includes an order, a scheduled sale starting, the REST API or WP-CLI. It clears:

  • the product page
  • the Shop page
  • the product’s category and tag archives
  • your static front page

Saving a product in wp-admin clears the whole site.

So the expiry only covers what xSpeed can’t see, such as a countdown in a theme block, or prices written straight to the database by an outside sync. We recommend 24 hours on a store, against the blog default of 168. If an outside system changes prices several times a day, go shorter.

Then turn on the Preloader (daily). It caches every page in your sitemap, including products and categories, before a shopper asks.

Step 3: Turn on the object cache

This is the step that helps the pages a page cache can’t: the cart, the checkout, the account area and wp-admin. All of them run WooCommerce’s database queries on every visit. An object cache keeps query results in memory, so repeated lookups skip the database. The gain grows with the store: many products, orders and logged-in shoppers mean many repeated lookups. On our small test store (one visitor at a time) it made no measurable difference to the checkout, so don’t expect a big jump on a tiny shop. Turn on Object Cache with Redis if your host provides it.

On xCloud, use xSpeed’s object cache and keep xCloud’s own Redis Object Caching toggle off. WordPress can only use one object cache at a time. Turning that toggle off doesn’t stop the Redis server: it keeps running, and xSpeed connects to it.

Step 4: Minify and combine

  • Minify HTML and Minify CSS: on (the wizard already did this).
  • Minify JavaScript: leave it off until you’ve placed a test order with it on. A store runs more scripts than a blog, and a broken one can sit on the checkout where you won’t see it while browsing.
  • Combine CSS and Combine JavaScript: off. On HTTP/2 and HTTP/3, separate files load in parallel, and a combined file has to be downloaded again after any change.

Step 5: Defer and Delay JavaScript, with store exclusions

This is the step that breaks checkouts when it’s done without care.

Delay JavaScript holds scripts back until the shopper scrolls, taps or types. On many product pages that’s a big win. On a checkout, it can mean the PayPal button doesn’t appear or the card form doesn’t load until someone touches the page. Today xSpeed runs Defer and Delay on the cart and checkout pages too, and it doesn’t ship store-specific exclusions yet. So before turning either on, paste this into Scripts to never defer or delay:

stripe
paypal
wc-add-to-cart
wc-add-to-cart-variation
wc-cart-fragments
wc-cart
wc-checkout
blocks/checkout-frontend
blocks/cart-frontend
blocks/mini-cart
recaptcha
challenges.cloudflare.com

Each line matches a script’s handle exactly, or any part of its address, before or after minification:

  • stripe covers Stripe for WooCommerce: the card form, Apple Pay and Google Pay buttons, and Stripe’s own script.
  • paypal covers PayPal Payments: its button script and the PayPal script it loads.
  • The wc- lines keep add to cart, the size and colour picker, the mini-cart count, and the classic cart and checkout running on time.
  • The blocks/ lines do the same for the block-based cart, checkout and mini-cart.
  • The last two cover reCAPTCHA or Cloudflare Turnstile on the checkout form.

Remove lines for plugins you don’t use. For another gateway, add part of its plugin folder name. Then turn on Defer JavaScript, test, and turn on Delay JavaScript, and test again. The Minify docs explain the matching in more detail.

Step 6: Product images and LCP

On a product page, the largest thing at the top is usually the product photo, and that’s what Google measures as LCP. Two settings make sure it’s the image the browser fetches first:

  • Images to load right away stays at 1. The first image loads straight away and the gallery thumbnails underneath still lazy-load.
  • If a logo, badge or sale banner comes before the photo, the first image may not be the product. Add one line to Main image rules (under Resource Hints) so the product’s own image is always the one preloaded:
post_type:product | featured

featured is the product image you set in WooCommerce. Raising the number of eager images is the wrong fix: it makes every thumbnail compete with the photo. The hero image guide has the full rule syntax.

Step 7: Keep the rest simple

  • Separate mobile cache: off. Most store themes are responsive, so phones and computers get the same page. Turning it on also stops nginx and Apache handing out cached pages directly, so every hit goes through PHP.
  • Cache pages for shoppers with a cart: your call. By default, a shopper with something in the cart gets freshly built pages. This setting keeps serving them cached pages, with one copy per cart so the mini-cart stays right. It’s worth trying on a busy store. Leave it off if your pages show anything else personal.
  • Load CSS without blocking: only acts on pages that have Critical CSS (Pro). With Pro, turn on Critical CSS first, then this.
  • Database cleanup: weekly. Under Tools › Database, set Automatic cleanup to Weekly and tick Expired Transients, Spam Comments and the two Orphan Meta items. A schedule cleans nothing until you tick items.

The test order: run it after every change

Use a private window, with your payment gateway in test mode:

  1. Open the shop and a product. The main image should appear straight away.
  2. On a variable product, choose a size or colour. The price and image should update.
  3. Add to cart. The header mini-cart count should change.
  4. In the cart, change a quantity and apply a coupon if you use them.
  5. At checkout, every payment button you offer should appear: card, PayPal, Apple Pay or Google Pay, and your CAPTCHA if you use one.
  6. Place the order. Check the thank-you page and the order email.
  7. Check the order appears under My account.

If a step fails, turn the last setting back off, then look at its exclusions.

What it changed: before and after

We ran both sides on the same WooCommerce test store, on the same server, within half an hour.

  • Before: xSpeed switched off, with nothing else caching pages or objects. We checked that every page was being built from scratch on each request.
  • After: xSpeed with the settings in this post, every page warmed and confirmed as a cache hit before testing.

Measured on 27 November 2026 on an xCloud Nginx server (8 GB RAM, 160 GB disk, Dallas), Hello Elementor theme with Elementor 4.4.2, a small test catalogue, xSpeed Cache 1.4.10 with Pro 1.3.11, WooCommerce 11.3.1, WordPress 7.1.5. TTFB is the median of 10 requests per page from one test machine; LCP is the median of 3 mobile PageSpeed Insights runs per page.

Time to first byte

PageBefore (no cache)After (xSpeed)
Home1,498 ms810 ms
Shop1,355 ms823 ms
Product1,442 ms877 ms
Checkout1,394 ms1,504 ms

Our test machine sat about 0.8 seconds from the server: a plain static file took 814 ms to arrive, and no page can beat that. Before, the server spent about half a second building each page on top of it. After, cached pages arrived as fast as the static file, so the server was doing almost no work at all.

Largest Contentful Paint (mobile)

PageBefore (no cache)After (xSpeed)
Home4.7 s3.2 s
Shop3.5 s2.1 s
Product2.9 svaried, 1.5–4.8 s*
Checkout7.4 s6.0 s

The home page’s main content appeared 32% sooner and the shop’s 40% sooner.

The checkout is never page-cached, so it showed no TTFB gain in our test; the difference is within normal run-to-run variation. Its LCP still improved, from 7.4 to 6.0 seconds. PageSpeed tests it with an empty cart.

* The product page is built with an Elementor template. With xSpeed on, its LCP swung between 1.5 and 4.8 seconds from run to run, against a steady 2.9 seconds without it. PageSpeed put the delay down to stylesheets that block rendering. If your product pages are built with a page builder, run PageSpeed on one before and after changing settings, and check the result holds over a few runs.

All the settings in one table

SettingStore value
Page cache, browser cache, GZIPOn
Cache expiry24 hours
PreloaderOn, daily
Object cacheOn (Redis)
Minify HTML / CSSOn
Minify JavaScriptOff until a test order passes
Combine CSS / JavaScriptOff
Defer / Delay JavaScriptOn, with the store exclusions above
Lazy loadOn, first image loads right away
Main image rulespost_type:product | featured
Separate mobile cacheOff
Cache pages for shoppers with a cartOptional
Database cleanupWeekly, items ticked

Running a content site too? Best xSpeed Cache settings for a blog is the short version. If wp-admin is the slow part, read Why is my WooCommerce admin slow?

Frequently asked questions

Will xSpeed Cache cache my cart or checkout?

No. WooCommerce marks the cart, checkout and account pages “do not cache” and xSpeed honours it, whatever the pages are called. Shoppers with items in their cart also bypass the cache unless you turn on Cache pages for shoppers with a cart.

How long should the cache last on a WooCommerce store?

24 hours. Price, stock and stock-status changes already clear the affected product, shop and category pages, so a short expiry isn’t what keeps prices right.

Is Delay JavaScript safe on WooCommerce?

Yes, with the exclusions in Step 5 and a test order afterwards. Without them, payment buttons and variation pickers can wait until the shopper touches the page.

Should I turn on a separate mobile cache for my store?

Only if your theme sends phones a different page. Most store themes are responsive, and the setting makes nginx and Apache serve every cached page through PHP.

Should xCloud’s Full Page Caching and Redis Object Caching be on as well?

No. On xCloud, xSpeed provides both, and running two of each conflicts. Keep xCloud’s toggles off. The Redis server keeps running with the toggle off, so xSpeed’s object cache still works. Click Re-sync Nginx Configuration in xCloud after changing xSpeed’s exclusions.

Make your site load in milliseconds.

One switch. Zero bloat. Always free to start.