How Magento splits public and private
A cached page is the same for everyone. Magento keeps it that way by leaving the personal parts out: the mini cart, the customer name and the form key are loaded afterwards by JavaScript, from customer/section/load, and stored in the browser. Cart, checkout and account pages are not cached at all.
When that split works, everyone gets a fast page and their own cart. When it breaks, one shopper’s state or an expired form key is served to many.
How it shows up
The symptoms are strange and intermittent: “Invalid Form Key” on add to cart, a mini cart that shows an empty basket, prices that do not match what the cart charges, a checkout that loads but will not advance. Refreshing sometimes fixes it, which makes it easy to dismiss.
A request that only checks for a 200 response never sees this. The page loads, fast, from cache. Only a real flow, adding a product, opening the cart and moving through checkout, shows that the state behind the page is wrong.
Check the headers
Ask the store whether a page came from cache. A product page should be cacheable; the cart and checkout must not be:
for u in / /checkout/cart/ /checkout/; do
echo "== $u"
curl -sI "https://example.com$u" | grep -iE "^(cache-control|age|x-cache|x-magento-cache-debug)"
doneX-Magento-Cache-Debug (HIT or MISS) only appears in developer mode. In production, a growing Age header or your CDN’s X-Cache tells the same story.| Page | Expected | Problem if |
|---|---|---|
| Home, category, product | Cacheable (`public`, Age grows) | Never cached: FPC is effectively off |
/checkout/cart/ | Never cached (`no-store`, `no-cache`) | Age above 0 or a HIT |
/checkout/ | Never cached | Age above 0 or a HIT |
customer/section/load | Never cached | Same response for different sessions |
The two classic mistakes
A block with cacheable="false" in a layout file makes the whole page uncacheable. Put it in default.xml and full page cache is off for every page of the store, which is a performance problem rather than a checkout bug, but it is common. Find such blocks:
grep -rn --include=*.xml 'cacheable="false"' app/code app/design vendor/*/*/view/frontend/layout | grep -v "/checkout_\|/customer_"The opposite mistake is worse: a hand-edited Varnish configuration that strips cookies or caches responses Magento marked private. Generate the VCL from Magento for your Varnish version and keep it in the repository with the code:
bin/magento varnish:vcl:generate --export-version=6 > varnish/default.vclA price, tax or shipping change in the admin does not always clear every cached page that shows it. Purge Varnish and the CDN after changes that affect what the cart charges.
Catch it from outside
Run the checkout flow on a schedule as a new visitor each time. A fresh session is exactly what a cache mistake punishes, so it is the best way to catch one before customers report it. Related: CDN caching rules on WooCommerce and Redis sessions and lost carts.
Check your own store now with the free Magento checkout test: it walks the checkout in a real browser, Luma or Hyvä, and shows the step where it stops.
Step-by-step fix when the product never reaches the cart: Magento 2 add to cart not working.
Find out your checkout broke before your customers do.
Real checkout checks for Magento and WooCommerce · free plan · no card requiredMagento checkout monitoring →