Skip to content

Never cache the WooCommerce cart and checkout

Best practices1 min readFixes check woo-cart-cached

A cached cart shows one shopper another's basket and breaks checkout. Exclude /cart/, /checkout/ and /my-account/ at every cache layer, including the CDN.

Step by step, with screenshots: WooCommerce: keep cart, checkout and account pages out of the cache →

Check your own site

Runs this check and the other 192, free, in about 45 seconds.

Or run only this check with the free WooCommerce SEO checker.

What it is

Caching the WooCommerce cart means a page cache or CDN stores a copy of /cart/, /checkout/ or /my-account/ and serves it to other visitors. Those pages are different for every shopper, so a cached copy can show one person another person's basket or break the checkout.

WooCommerce marks these pages as not cacheable, and every major caching plugin excludes them by default. The problem usually comes from a layer that ignores those signals: a host's server cache, Cloudflare with a cache-everything rule, or a CDN set up for speed without shop exceptions.

OK looks like this: cart, checkout and account pages, and any request carrying a woocommerce_ cookie, bypass every cache layer, and their responses show cache-control: no-store or a cache status of BYPASS or MISS. getReport requests those pages and fails the check if any comes from a cache.

What a passing site looks like

  • Cart and checkout bypass the page cachefail · −8 ptseffort M

Cached cart and checkout

Why it matters. A cached /cart/ or /checkout/ shows one visitor another visitor's basket, breaks nonces and payment forms, and produces the "session expired" errors shoppers abandon on. Every caching plugin excludes these pages by default; a CDN or host cache in front of them often does not.

How to fix it.
  1. Exclude /cart/, /checkout/ and /my-account/ (and their translations) from every cache layer: the caching plugin, the host's page cache and the CDN (Cloudflare: a Cache Rule with "Bypass cache" for those paths and for requests with a woocommerce_* cookie).
  2. Re-test after purging: the responses should carry cache-control: no-store or a cache status of BYPASS/MISS.

Questions people ask

Should you cache WooCommerce pages?

Yes for product, category and content pages, which are the same for everyone and load much faster from cache. No for the cart, checkout and My Account pages, and for any visitor with items in the cart, whose pages are personal. Configure every cache layer, including the CDN, with those exceptions.

What is the best cache plugin for WooCommerce?

Use the one your host recommends or builds in, because server-level caching is fastest and already knows WooCommerce's rules. LiteSpeed Cache on LiteSpeed servers, WP Rocket and other well-known plugins all exclude cart, checkout and account by default. Running one well-configured cache beats stacking several.

Why does my WooCommerce cart show the wrong items?

Almost always because the cart page or the mini-cart is being served from a cache: the visitor sees a copy made for someone else, or an old copy of their own cart. Exclude /cart/, /checkout/ and /my-account/ from the host and CDN caches, purge everything, and test in a private window.

How do you clear the WooCommerce cache?

Purge every layer: your caching plugin's clear-all button, the host's server cache in its control panel, and the CDN (in Cloudflare, Caching → Purge Everything). WooCommerce's own transients can be cleared under WooCommerce → Status → Tools. Then reload a product page twice to rebuild the cache.

Filed under WordPress & WooCommerce. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.