Caching the wrong pages
| Path or request | At the edge |
|---|---|
| Product and category pages, static assets | Cache |
/cart/, /checkout/, /my-account/ | Bypass |
?wc-ajax=* (update_checkout, checkout, fragments) | Bypass |
/wp-json/wc/store/* (block cart and checkout) | Bypass |
Requests with woocommerce_items_in_cart or wp_woocommerce_session_* cookies | Bypass |
/wp-admin/, /wp-login.php | Bypass |
A “Cache Everything” rule without these exceptions serves one customer’s cart, or an empty checkout, to everyone. Symptoms: cart counts that do not change, totals that do not update, “session expired” on Place Order.
# A checkout response must not come from the edge cache
curl -sI https://example.com/checkout/ | grep -i cf-cache-status
# expected: DYNAMIC or BYPASS, never HITBot protection
Bot Fight Mode, managed challenges and WAF rules can answer the checkout’s background requests with a challenge page instead of JSON. The browser cannot solve a challenge inside an AJAX call, so the checkout spins or shows a generic error.
Gateways confirm payments with server-to-server calls to /?wc-api=… or /wp-json/…. Challenge those and orders stay pending even though the customer paid. See payment gateway failing.
Add a WAF skip rule for the checkout endpoints and the gateway’s webhook path, and check Security → Events for challenges on wc-ajax or wc/store requests. The exact rule, and how to confirm the block, are in Cloudflare WAF blocking WooCommerce checkout AJAX.
Edge optimisation
Rocket Loader, script minification and email obfuscation change the JavaScript the checkout runs. Payment fields from Stripe, PayPal and others load in iframes from their own scripts; a deferred or rewritten script loads them late or not at all.
- Turn off Rocket Loader for the checkout. Use a Configuration Rule on
/checkout/*, or turn it off site-wide. - Exclude gateway scripts from optimisation. In Cloudflare and in any WordPress optimisation plugin.
- Purge after each change, then test. A full checkout with each payment method, in a private window.
Related: cart fragments and performance and update_checkout not working.
Check your own store now with the free WooCommerce checkout checker: it walks the checkout in a real browser, stops before payment, and shows the step where it breaks.
Find out your checkout broke before your customers do.
Real checkout checks for Magento and WooCommerce · free plan · no card requiredWooCommerce checkout monitoring →