Blog
SavedSearch
Visit Hostlelo

WooCommerce Black Friday: Cache Exclusions That Save Checkout

Keep Cart, Checkout and My Account out of every cache layer before Black Friday on 27 November 2026, then prove it with a quick curl header check.

The short answer

WooCommerce Cart, Checkout and My Account pages must never be served from page cache, and Store API, wc-ajax and cart-session requests must bypass it too. Verify with a real GET request: checkout must never return a cache HIT, required Set-Cookie headers must survive, and a full test order must work. Exact Cache-Control directives vary by stack.

WooCommerce cart and checkout requests bypassing a page cache while normal pages stay fast
Reading options

On this page

Before you start

You need WordPress admin access, access to every cache layer in use (plugin, host and CDN), a current restorable backup, the real WooCommerce page slugs, and a test product. Make changes in staging or a low-traffic window, purge affected caches, and complete a real cart-to-order test.

If your WooCommerce store uses page caching, the Cart, Checkout and My Account pages must never come out of that cache, and neither should any request from a shopper who already has items in the cart. You set this in your caching plugin and in Cloudflare if you use it, then prove it with a short curl check.

Thanksgiving in the United States falls on Thursday 26 November 2026 according to the US Office of Personnel Management holiday schedule, which puts Black Friday on Friday 27 November and Cyber Monday on Monday 30 November. That is ten days from today.

By the end of this guide you will know which pages and cookies to keep out of cache, how to set those exclusions in WP Rocket, LiteSpeed Cache, Cloudflare and Nginx, and how to confirm from your own terminal that checkout is served fresh every time.

What page caching does to a store, and why carts break

A page cache saves a finished copy of a page the first time someone visits, then hands that same copy to the next visitor. WordPress does not have to build the page again, so it loads fast and your server stays calm under traffic.

Think of a bakery that bakes one tray of bread in the morning and sells from it all day. Fine for bread. Terrible for a birthday cake with a name on top.

Your blog posts and product pages are the bread. The cart, checkout and account pages are the birthday cakes. WooCommerce's own caching guide says these pages "need to stay dynamic since they display information specific to the current customer and their cart."

When one of these pages gets cached, the bugs look random. A cart says it is empty right after an add. A customer who tries to reset a password keeps being sent back to the login screen. WooCommerce's caching guide explains that last one: some hosts with server-side caching do not stop my-account.php from being cached, and a password reset loop is the result.

A made-up example: Priya runs a small tea shop. Her cache plugin is fine, but she added a Cloudflare rule to cache all HTML so the shop would feel faster. One evening a customer emails to say checkout shows someone else's billing country. The edge rule was serving one saved copy of checkout to everyone. You want to find that gap now, on a quiet day.

Before you start

  • Admin access to WordPress, and SSH access if you want to use the WP-CLI and curl commands below.
  • Access to your Cloudflare dashboard, if your domain uses Cloudflare.
  • A staging copy of the store, or at least one cheap test product you can add to a cart and then remove.
  • A fresh backup of files and database, taken today. If you have WP-CLI, wp db export creates a database dump. Our guide on a safe backup plan for WordPress auto-updates covers a full backup and restore routine.
  • A low-traffic window. Changing cache rules purges or bypasses saved pages, so the server works harder for a short time.
  • The name of your caching plugin, and whether your host adds its own server cache on top. If you are not sure, ask your host before you change anything.

Quick tip: write down every setting you change, with its old value. If something goes wrong, you can put it back in minutes.

Step-by-step: find what must stay dynamic

Step 1: Confirm which pages WooCommerce treats as Cart, Checkout and My Account

WooCommerce stores the ID of each of these pages in its settings. If someone made a second cart page or renamed a slug, your exclusions might point at the wrong address.

If you have WP-CLI, run this to read the page IDs WooCommerce has stored.

wp option get woocommerce_cart_page_id
wp option get woocommerce_checkout_page_id
wp option get woocommerce_myaccount_page_id

Each command prints a number. Then look up the slug and full address of those pages, swapping in the three numbers you got (the ones below are made up).

wp post list --post_type=page --post__in=7,8,9 --fields=ID,post_name,url

You should see three rows, usually with slugs like cart, checkout and my-account. Write those slugs down. Every exclusion in this guide uses them.

Why this matters: in the WooCommerce source, the prevent_caching function sets the DONOTCACHEPAGE constant and adds no-cache headers only when the current page is one of these three IDs. A cart block placed on some other page does not get that protection.

Step 2: Learn the cookies WooCommerce sets

A cookie is a small note the browser keeps and sends back on every request. WooCommerce uses a few of them to remember who has a cart. The WooCommerce caching guide lists these cookies to exclude from caching.

woocommerce_cart_hash        session    tracks when cart contents change
woocommerce_items_in_cart    session    tracks when cart contents change
wp_woocommerce_session_      2 days     unique code that finds the cart in the database
woocommerce_recently_viewed  session    powers the Recently Viewed Products widget
store_notice[notice id]      session    lets customers dismiss the store notice

Heads up: wp_woocommerce_session_ is a prefix, not a full name. In the WooCommerce source, the real cookie name is wp_woocommerce_session_ followed by WordPress's COOKIEHASH, which is an MD5 hash of your site address. The live cart page on woocommerce.com, checked today, set exactly that kind of cookie. So match on the prefix, never on a full name copied from another site.

WordPress core names its logged-in cookie wordpress_logged_in_ plus the same hash. Logged-in shoppers see their own details, so treat that cookie the same way.

Step 3: Copy the real cookie names from your own store

Do not trust any list blindly, including this one. WooCommerce lets code rename the session cookie through the woocommerce_cookie filter.

Open your shop in a private window, add the test product, then open the browser developer tools and look at the cookies for your domain. You should see woocommerce_items_in_cart, woocommerce_cart_hash and a wp_woocommerce_session_ cookie with your site's hash on the end.

You can also see the cookies from the terminal. This request asks for headers only and shows any cookie your cart page sets.

curl -sS -D - -o /dev/null https://example.com/cart/ | grep -i -E "set-cookie|cache-control"

The command makes a real GET request and prints only its response headers. Header values vary by WordPress version, cache plugin and CDN, so do not require one exact Cache-Control string. The safety check is that the response is not served as a cache hit, and any Set-Cookie header reaches the browser.

Set the exclusions in your caching plugin

Follow only the section for the plugin you already use. Do not install a second page cache to follow along.

WP Rocket

The WP Rocket documentation says it "Automatically excludes the Cart, Account and Checkout pages, as set in your WooCommerce settings." Step 1 already confirmed those settings point at the right pages.

If you have other pages that show per-customer content, such as a wishlist or a custom order tracking page, add them yourself. Go to the Advanced Rules tab in WP Rocket and find the Never cache URL(s) box. Enter one address per line, either a full URL or just the path.

/wishlist/
/order-tracking/(.*)

WP Rocket's docs explain that /order-tracking/(.*) covers child pages but not the parent page itself, so list the parent on its own line if you need it. Be careful with patterns: /(.*) would exclude every page on the site.

Heads up: WooCommerce's guide also says to avoid JavaScript minification with WP Rocket on a store.

LiteSpeed Cache

The LiteSpeed Cache documentation says: "By default, the My Account, Checkout, and Cart pages are excluded from caching." If you are new to the plugin, our LiteSpeed Cache setup guide for WordPress covers installation, so I will stay with exclusions here.

Open the plugin's Cache settings and go to the Excludes tab. The field you want is Do Not Cache URIs, one entry per line. LiteSpeed compares each entry with the REQUEST_URI server variable and allows partial matches. Add ^ at the start to mean "begins with" and $ at the end to mean "exact match".

^/wishlist/
^/order-tracking/

The same tab has Do Not Cache Cookies. Use it carefully. The LiteSpeed docs give this tip: "If you exclude a cookie that appears on every page of your site, you effectively exclude your entire site from caching." So never add a cookie that a script or consent banner gives every visitor.

WP Super Cache

WooCommerce's caching guide says WP Super Cache is natively compatible: WooCommerce signals the plugin not to cache the Cart, Checkout or My Account pages by default. Confirm the three pages from Step 1, then run the tests below.

Set a bypass rule in Cloudflare

Cloudflare's documentation says plainly: "The Cloudflare CDN does not cache HTML or JSON by default." So with default settings, your cart and checkout HTML already goes straight to your server. Cloudflare also will not cache a response that sends a Set-Cookie header, or one marked private or no-store.

The risk appears when someone adds a Cache Rule that makes HTML eligible for cache, often to speed up the home page. That is what caught the made-up tea shop. If you have a rule like that, you need a bypass rule that wins.

Step 4: Create the Cache Rule

In the Cloudflare dashboard, open the Cache Rules page for your domain and click Create rule. Give it a clear name, such as "Store: never cache cart, checkout, account".

Under When incoming requests match, choose a custom filter expression. Cloudflare's own bypass-on-cookie example uses the http.cookie field with the contains operator. Switch to the expression editor and paste an expression like this one, replacing the paths with the slugs from Step 1.

(starts_with(http.request.uri.path, "/cart/")) or (starts_with(http.request.uri.path, "/checkout/")) or (starts_with(http.request.uri.path, "/my-account/")) or (starts_with(http.request.uri.path, "/wp-json/wc/store/")) or (http.request.uri.query contains "wc-ajax=") or (http.cookie contains "woocommerce_items_in_cart") or (http.cookie contains "wp_woocommerce_session_") or (http.cookie contains "wordpress_logged_in_")

The path checks use starts_with, so replace the three storefront slugs with the real paths from Step 1. The Store API path and wc-ajax query cover WooCommerce's dynamic cart and checkout requests. Cookie checks still use contains, so the wp_woocommerce_session_ prefix matches your site's full cookie name.

Under Then, in the Cache eligibility section, choose Bypass cache. Under Place at, put this rule after any rule that makes HTML eligible for cache. Cloudflare's docs on rule order say that for conflicting settings, such as bypass versus eligible for cache, "the last matching rule wins." Then click Deploy.

Heads up: Cloudflare's own example page spells its sample cookie two ways, test_cookie in the text and test-cookie in the expression. Copy cookie names from your own browser, as in Step 3, and never retype them from a blog post, this one included.

Server-level exclusions with Nginx FastCGI cache

Some servers cache pages before WordPress even runs. Nginx FastCGI cache is a common one. If your host manages it, ask them to confirm their WooCommerce exclusions. If you manage your own server, Nginx gives you two directives: fastcgi_cache_bypass stops a saved copy from being served, and fastcgi_no_cache stops a response from being saved. The Nginx docs say a request skips the cache when at least one value you pass is not empty and is not equal to 0.

Before you edit a live server config, copy the current file somewhere safe, for example with cp to a dated backup name. Then you can add a block like this inside the server block that uses FastCGI cache.

set $skip_cache 0;
if ($request_uri ~* "/(cart|checkout|my-account)/|/wp-json/wc/store/|[?&]wc-ajax=") {
    set $skip_cache 1;
}
if ($http_cookie ~* "woocommerce_items_in_cart|wp_woocommerce_session_|wordpress_logged_in_") {
    set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;

Test the config with nginx -t before you reload. If the test fails, restore your copy and reload.

On a LiteSpeed web server, the LiteSpeed Cache plugin settings above control what the server caches, so you normally do not need extra server rules. For Apache-based caches and Varnish, follow your host's documentation. WooCommerce's guide includes Varnish rules if you run Varnish yourself.

How to check it worked

Settings screens tell you what you meant to do. Response headers tell you what a shopper actually receives.

Step 5: Check the cart, checkout and account pages

Run this against each of the three pages, twice in a row, because a page cached on the first visit shows it on the second.

curl -sS -D - -o /dev/null https://example.com/checkout/ | grep -i -E "cache-control|set-cookie|cf-cache-status|x-litespeed-cache"

Here is what you should see on cart, checkout and account pages:

  • If you use Cloudflare, cf-cache-status is not HIT; DYNAMIC, BYPASS or a first-request MISS can all be valid depending on the rule and response.
  • If you use LiteSpeed, there is no x-litespeed-cache: hit header.
  • Any Set-Cookie header needed by WooCommerce is preserved. Treat Cache-Control as supporting evidence because its exact directives vary by stack.

What do DYNAMIC and BYPASS actually mean? Cloudflare's docs say DYNAMIC is decided at request time, before any cache lookup. You see it for HTML under default settings and when a Bypass cache rule matches. BYPASS means the request looked cacheable, but the origin's response said no, for example because it sent no-store or private. Both mean the shopper got a fresh page. HIT means they got a saved copy, which is what you must never see here.

Step 6: Check a normal page with and without a cart cookie

Now check that normal pages are still fast. Run this against your home page or a product page twice.

curl -sS -D - -o /dev/null https://example.com/ | grep -i -E "cf-cache-status|x-litespeed-cache"

If you cache HTML at the edge, the second run should show cf-cache-status: HIT. With LiteSpeed, the LiteSpeed troubleshooting guide says you should see X-LiteSpeed-Cache: hit after a second request from a logged-out visitor. If you never see a hit anywhere, your exclusions may be too wide.

Next, pretend to be a shopper who has a cart. The -b option sends a cookie with the request, in NAME=VALUE form.

curl -sS -D - -o /dev/null -b "woocommerce_items_in_cart=1" https://example.com/ | grep -i -E "cf-cache-status|x-litespeed-cache"

With the Cloudflare rule from Step 4 in place, this should show DYNAMIC instead of HIT. That proves the cookie part of the rule matches.

Step 7: Run a real add-to-cart test

Headers prove the rules, and a real cart proves the experience. Use two different browsers.

  1. In browser A, add the test product to the cart and open the cart page. The product should be there.
  2. In browser B, open the cart page. It must be empty.
  3. In browser A, go to checkout and check that the form is blank or shows only your own details.
  4. Log in to a test customer account in browser A, then open My Account in browser B. Browser B must not show that customer.
  5. Log out, use the lost password link for the test account, and follow the email. You should reach a new password form, not loop back to the login screen.
  6. Remove the test product from the cart.

If every step passes, your cart and checkout are being served fresh.

Troubleshooting

Cart page shows cf-cache-status: HIT

Symptom: the curl check on /cart/ or /checkout/ returns HIT. Likely cause: an older or broader Cache Rule makes HTML eligible for cache and runs after your bypass rule, or your bypass expression has a typo in the path. Fix: open Cache Rules, check the order under Place at, and confirm the path in your expression matches the real slug from Step 1. Purge the cache for those addresses after the fix, then test again.

Customers cannot reset their password

Symptom: the reset link keeps sending people back to the login screen. Likely cause: WooCommerce's guide says some hosts with server-side caching do not stop my-account.php from being cached. Fix: use the real-GET check to confirm My Account is never returned as a cache HIT. Record its Cache-Control value without requiring one fixed string. If plugin settings are right and it still loops, ask your host to exclude the page from server cache.

The mini cart shows the wrong number of items

Symptom: the header cart icon shows zero items, or a number from an earlier visit, while the cart page itself is right. Likely cause: the cart widget is refreshed by a background request for cart fragments, and the WP Rocket docs say it optimizes the get_refreshed_fragments request automatically. Fix: if you use WP Rocket and see this, the WP Rocket docs suggest turning that feature off. Then repeat the Step 7 test.

Nothing is cached any more and the site feels slow

Symptom: after your changes, every page returns x-litespeed-cache: miss or cf-cache-status: DYNAMIC, even the home page. Likely cause: you excluded a cookie that every visitor gets, such as a consent or analytics cookie, or a URL pattern like /(.*) that matches everything. Fix: remove the last exclusion you added, purge, and run the Step 6 check again until normal pages show a hit.

Pro tips and security notes

Set a freeze window. From a few days before 27 November until after 30 November, avoid plugin, theme and WooCommerce updates unless a security fix is announced. An update can change cookie names, page slugs or cache plugin defaults, and you would not have time to retest. If auto-updates are on, decide now which ones to pause.

Add an object cache only if you have tested it. An object cache stores database query results in memory, which is different from page caching. WooCommerce's caching guide says that if your caching system offers database caching, consider excluding _wc_session_. Our Redis object cache setup guide walks through a safe setup, but do not add it for the first time in the week of a sale.

Read every Cloudflare rule you did not create. Open the Cache Rules page and go through the list top to bottom before the weekend.

Know when to ask the host. If you see a cache header you do not recognise, or HIT on checkout when every plugin setting looks right, there is probably a server cache you cannot see from WordPress. Send your host the exact headers from your curl output. That gets you a useful answer much faster than "my cart is broken".

The one message worth forwarding

If a developer or your host manages caching for you, send them this message as it is.

Hi, before Black Friday (27 November 2026) please confirm our page caching for example.com:

1. The Cart, Checkout and My Account pages are never cached at any layer (plugin, server and Cloudflare).
2. Requests carrying the woocommerce_items_in_cart, wp_woocommerce_session_ (prefix) or wordpress_logged_in_ (prefix) cookies skip the page cache.
3. No cookie that every visitor receives is used as a cache exclusion.

Please check with:
curl -sS -D - -o /dev/null https://example.com/checkout/ | grep -i -E "cache-control|set-cookie|cf-cache-status|x-litespeed-cache"

Expected: cf-cache-status is never HIT on checkout, there is no x-litespeed-cache: hit, and any required Set-Cookie header is preserved. Cache-Control varies by stack, so record it but do not require a fixed string.

Also, please confirm no plugin, theme or cache configuration changes from 24 November to 1 December unless it is a security fix. Thank you.

The takeaway: a store is only as safe as its leakiest cache layer. Set the exclusions, test with a real GET request, and complete a real cart and checkout flow before the sale.

Reader questions

When is Black Friday in 2026?

US Thanksgiving falls on Thursday 26 November 2026 according to the OPM federal holiday schedule, so Black Friday is Friday 27 November and Cyber Monday is Monday 30 November.

Why does every page show DYNAMIC right after I change Cloudflare settings?

Check whether Development Mode is on. Cloudflare's documentation says Development Mode suspends caching for three hours, and requests show DYNAMIC while it is active.

Can Cloudflare cache a page that sends no Cache-Control header?

Yes, if the request is eligible for cache. Cloudflare's default behaviour gives 200, 206 and 301 responses a 120-minute edge TTL even without a Cache-Control header.

Which header wins if my server sends both CDN-Cache-Control and Cache-Control?

Cloudflare's documentation says CDN-Cache-Control and Cloudflare-CDN-Cache-Control take precedence over Cache-Control. A no-store or bare private value in them results in BYPASS.

Why is the session cookie name different on every WooCommerce store?

WooCommerce builds it from the wp_woocommerce_session_ prefix plus WordPress's COOKIEHASH, which is an MD5 hash of the site address. Two stores on different addresses will never share the same full cookie name.

Should I add Redis object caching right before Black Friday?

Only if you have already tested it on your store. WooCommerce's caching guide suggests excluding _wc_session_ from database caching, and a first-time setup during sale week leaves little room to fix problems.

Sources & further reading

  1. WooCommerce: Configuring caching plugins
  2. LiteSpeed Cache for WordPress: Cache settings
  3. WP Rocket: Using WP Rocket on your WooCommerce site
  4. Cloudflare: Default cache behavior
  5. Cloudflare: Cloudflare cache responses
  6. Cloudflare: Create a cache rule in the dashboard
  7. Cloudflare: Cache Rules order
  8. Nginx: ngx_http_fastcgi_module
  9. OPM: Federal holidays
  10. WP-CLI: wp post list

What changed

Replaced HEAD-only checks with real GET header tests, removed rigid Cache-Control expectations, added Store API and wc-ajax bypass coverage to CDN and Nginx examples, narrowed path matching, and required a full checkout test. Added original accessible media.

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close