Last updated: · By Asael Dreyer
In short: A WooCommerce cart that empties, an old price, or a “cart with 0 items” right after adding a product is almost always a cache problem: a dynamic page was cached and served to a different visitor. The fix is to exclude the cart, checkout and account pages, and the WooCommerce cookies, from every cache layer: Varnish, Breeze and Cloudflare. On Cloudways, Varnish and Breeze exclude them by default, so the problem usually comes from a Cloudflare cache rule or a non-standard theme.
⏱ Time to fix: 15 to 40 minutes · Difficulty: medium · Last checked: 7 Nov 2026
| Cache layer | Excludes cart, checkout and account by default? | What to check |
|---|---|---|
| Varnish (the Cloudways server) | Yes: /cart, /checkout, /my-account, ?add-to-cart=, wc-ajax and the WooCommerce cookies | Non-English or custom URLs, and cookies added by plugins |
| Breeze (the cache plugin) | Yes: Cart, Checkout, My Account | Page builders and non-standard cart templates |
| Cloudflare with HTML caching | No, unless you set a bypass rule | A Cache Everything or Eligible for cache rule that also catches the shop |
The data in the table comes from the Cloudways Varnish guide and the Breeze advanced rules guide, as of 7 Nov 2026.
Why does the WooCommerce cart empty or show an old price?
Page caching stores a ready-made HTML copy of a page and serves it to everyone who requests it. That’s great for a product page that looks the same to everybody, and dangerous for a page whose content is different for every shopper.
WooCommerce knows which cart belongs to whom by using cookies. According to the WooCommerce documentation, the cookie wp_woocommerce_session_ holds a unique code for each customer for two days, and woocommerce_items_in_cart and woocommerce_cart_hash mark that the cart has changed. If a cache layer serves a stored page without looking at those cookies, the shopper sees someone else’s cart, or an empty one.
The common symptoms:
- You add a product, go to the cart, and it’s empty.
- The cart icon in the header shows the wrong number of items, or the same number for every visitor.
- You changed a price or started a sale, and on some pages the old price still shows.
- A password reset in “My Account” keeps returning to the login screen.
The last case is documented by WooCommerce itself: a password reset loop is caused when the My Account page is cached by the server.
How do you know which cache layer is to blame?
You check the response headers of the cart page. It takes two minutes and saves guessing.
- Open the cart in a regular window (not incognito), add a product, and open the browser’s developer tools (F12) > Network.
- Refresh the cart page and click the first request (the document itself).
- Look for cf-cache-status. If it says HIT on the cart or checkout, Cloudflare is serving them from cache. The right answer for those pages is DYNAMIC, BYPASS or MISS.
- Look for the server’s cache header (on Cloudways it’s x-cache). A HIT on the cart means Varnish is serving it from cache.
- Open the page source (Ctrl+U) and look for a Breeze comment at the bottom. If it appears on the cart, Breeze cached it.
What I measured myself (7 Nov 2026): on my own site, which isn’t a store, Cloudflare caches the content pages. I sent a request with a logged-in visitor’s cookie and got cf-cache-status: DYNAMIC, meaning the rule bypasses the cache. I sent the same request with the cookies woocommerce_items_in_cart and woocommerce_cart_hash and got HIT. On a content site that’s fine. On a store, it’s exactly the recipe for a cart that looks empty: a Cloudflare HTML rule written for a blog and carried over to a shop as it was.
How do you exclude the cart from Varnish on Cloudways?
In most stores you don’t need to: Varnish on Cloudways excludes /cart, /checkout, /my-account, /wc-api, ?add-to-cart= and the request ?wc-ajax=get_refreshed_fragments by default, plus the cookies woocommerce_cart, woocommerce_session and wp_woocommerce_session. Every POST request is excluded too.
You need to add an exclusion when your pages don’t sit at those addresses. A common example: a cart page at a translated or custom slug such as /cart-page, a checkout on a custom landing page, or a plugin that adds its own cookie (currencies, a loyalty club, shipping).
- In the panel, open Servers, then choose your server and your application.
- Under Application Management choose Application Settings and go to the Varnish Settings tab.
- In the Type field choose URL, and in the Value field type a relative address (for example /cart-page). A full address with the domain won’t work.
- For a cookie, choose Cookie and type the full cookie name. A regular expression works too.
- Click Save, and then purge Varnish so the old copies are deleted.
A full explanation of exclusion rules, TTL and Ignore Query String is in the Cloudways Varnish guide. How to purge all the cache layers at once: clearing the server cache.
What should you check in Breeze?
Breeze recognizes the Cart, Checkout and My Account pages by WooCommerce’s default structure and skips them without any setup. According to Cloudways, if one of them is still served from cache, the cause is usually a page builder or a non-standard cart template.
- In WordPress, open Settings > Breeze > Advanced Options.
- In the Never Cache These URLs field add the cart, checkout and account addresses as they appear on your site, and any page with a dynamic form.
- Save and purge the Breeze and Varnish caches. According to the Breeze FAQ, the Varnish cache isn’t stored in the wp-content/cache folder, so you have to purge it too.
Another trap: the Cache Logged-in Users option. If you enabled it for the Customer or Subscriber role, logged-in customers may see another customer’s content. In a store, leave it off. The full Breeze settings are in the Breeze guide.
How do you set up Cloudflare so it doesn’t cache the cart?
Cloudflare doesn’t cache HTML by default. The problem starts when you add a Cache Everything or Eligible for cache rule to speed up the site, and it’s probably the most common reason for an empty cart on stores connected to Cloudflare.
According to Cloudflare’s documentation, when a dynamic page is cached, Cloudflare can strip the Set-Cookie header from it, and the browser never receives the session cookie. Their recommendation: limit the cache rule to static paths, and add a specific rule that bypasses the cache on /cart, /checkout, /account and API paths.
- In Cloudflare, open the cache rules (Cache Rules) and find the rule that caches HTML.
- Add a bypass rule (Bypass cache) before it for the paths /cart, /checkout, /my-account, /wc-api, ?wc-ajax= and for requests with the add-to-cart parameter.
- Add a cookie-based bypass condition: any request that contains woocommerce_items_in_cart, wp_woocommerce_session_ or wordpress_logged_in.
- Purge the Cloudflare cache (Purge Everything) and check cf-cache-status on the cart again.
If you use Cloudflare Enterprise through Cloudways (Edge Page Caching), you get the same exclusions as Varnish automatically, according to the Cloudways Cloudflare guide. One limitation to know: the same guide says excluding custom cookies for Edge Page Caching isn’t available yet. A store that depends on a plugin’s cookie should check that before turning it on. The full explanation of HTML caching on Cloudflare for WordPress: how to cache HTML on Cloudflare without breaking your site.
Why does an old price show after I updated a product?
This is the opposite problem: it’s not that the cart was cached by mistake, but that the product page or category page stayed in cache after the change. Breeze purges a page’s cache when you update it or when stock changes, but a category page, the home page or the Cloudflare cache don’t always get purged along with it.
- A scheduled sale: a sale price that starts at a set time depends on WP-Cron. A page cached before the sale begins will show the old price until the cache expires. Purge the cache right after the sale opens, or shorten the cache lifetime on sale days.
- Cloudflare: connect Breeze to Cloudflare so it purges the cache there too when you update content. The setup is described in the Breeze and Cloudflare integration guide.
- Object Cache: if a wrong price also shows on a page that isn’t cached, try purging the Object Cache (Redis). It’s rare, but it happens after importing products straight into the database.
The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.
The offer ends on December 4, 2026 at 23:59 (UTC+2).
Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.
After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator
Start a free trial server, no credit card. When you move to a paid plan, the code ASAEL takes 30% off your bill for the first three months.
The link fills in the code on the signup form. Just make sure it shows up.
Common mistakes and how to solve them
Two cache plugins at once: Breeze and another cache plugin each store their own copy, and each excludes different pages. Keep only one cache plugin. A comparison: WordPress cache plugins.
JavaScript minification: WooCommerce recommends avoiding minification of JS files in the cache plugin. If the “Add to cart” button stopped working after you turned on optimization, turn off JS combining and test again.
A “fix” that turns off all the cache: turning off Varnish solves the cart, but slows down the whole store. Before you turn it off, find the guilty layer from the headers. If the checkout is slow and not broken, that’s a different topic: slow WooCommerce checkout.
Frequently asked questions
Almost always because of cache: the cart page, or the cookies that identify the cart, go through a cache layer that serves a stored copy. Check cf-cache-status and x-cache on the cart page, and exclude it in the layer that returns HIT.
Yes. Cloudways configures Varnish for WooCommerce by default, including exclusions for the cart, checkout, account and session cookies. You only need to add exclusions for custom URLs or plugin cookies.
No, if the store uses WooCommerce’s default pages. Breeze excludes them automatically. If you built the cart or checkout with a page builder or at a different address, add them manually and purge the cache.
You can, only with bypass rules for the cart, checkout, account, add-to-cart requests and the WooCommerce cookies. Without those rules Cloudflare will serve stored pages to shoppers and may strip the session cookie.
Because the product page, the category page or the copy on Cloudflare is still stored. Purge the cache in every layer, and connect Breeze to Cloudflare so the purge happens automatically on the next update.
Yes. According to the WooCommerce documentation, the common cause is that the My Account page is cached by the server. Make sure the page is excluded from every cache layer and try again in an incognito window.
Related guides
- Varnish on Cloudways: exclusions, TTL and purging
- Breeze: recommended settings for WordPress and WooCommerce
- HTML caching on Cloudflare for a WordPress site
- Slow WooCommerce checkout: what to check
- WooCommerce store hosting on Cloudways
- All the guides on this topic: WordPress and WooCommerce guides
Sources
- How to Use Varnish at Cloudways – Cloudways KB (default WooCommerce exclusions, URL and cookie exclusion)
- Breeze Advanced Rules – Cloudways KB (Never Cache These URLs, automatic exclusion of WooCommerce pages)
- Breeze Cache on Cloudways FAQ – Cloudways KB
- How to Enable Cloudflare on Your Application – Cloudways KB (Edge Page Caching)
- Configuring caching plugins – WooCommerce Docs (cookies, pages to exclude, the password reset loop)
- Dynamic content and login issues – Cloudflare Docs
Official sources: Cloudways Knowledge Base and WooCommerce Docs. Written and checked by Asael Dreyer · Updated: 7 Nov 2026
Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details