Caching is the biggest performance win available to a shop, and the fastest way to break one. The rule is simple: cache what is the same for everybody, never cache what is personal.
Never cache these pages
- Cart
- Checkout
- My Account
If these are cached, one customer sees another customer's basket, or their name and address at checkout. Most caching plugins exclude them automatically, but you must confirm it rather than assume – particularly if your pages use non-standard names or you are on a non-English site where the slugs differ.
Also exclude
- Any page carrying order details, such as order-received
- Anything behind a login
- The WooCommerce API and AJAX endpoints
Cookies matter
WooCommerce sets cookies when a basket has something in it. A properly configured cache will bypass itself for a visitor carrying those cookies, so a shopper with items in their basket always gets a fresh page. If your cache ignores cookies, the mini-basket in the header will show the wrong contents – the classic symptom of caching set up without regard for WooCommerce.
Testing it
Add something to the basket in a private browser window, then open the shop in a different browser entirely. The second browser must show an empty basket. If it shows the first browser's items, stop and fix the cache before going any further.
What to cache
Product pages, category pages and the home page – the pages that are identical for everyone and make up the bulk of your traffic.