← Back to blog
Guides· June 27, 2026 ·Updated Jun 29, 2026 ·5 min read

Caching a WooCommerce store without breaking the cart

Full-page caching and a live shopping cart sound like sworn enemies — until you bypass the right cookies. Here is exactly how to make a WooCommerce store fly while checkout keeps working perfectly.

Mads Edelskjold
Mads Edelskjold
Founder, NordicCDN · ex-datacenter CTO
Caching a WooCommerce store without breaking the cart
The short version

A WooCommerce store is mostly identical for every shopper — and that part can be cached at the edge for instant loads. The cart, checkout and account pages are personal, so you bypass the cache for them by detecting WooCommerce's session cookies. Cache the catalog, bypass the cart, and you get a shop that feels instant without a single plugin.

Ask anyone why they haven't put their WooCommerce store behind a cache and you'll usually get the same answer: "I can't — my cart is dynamic." It's a reasonable worry. Nobody wants a shopper to add three items, hit checkout, and see an empty cart because a stale page got served. But that fear keeps a lot of shops slow for no good reason, because the objection is solvable in about two minutes.

The trick isn't to cache less. It's to cache the 95% of your shop that's the same for everyone, and be precise about the 5% that isn't.

Why WooCommerce is slow in the first place

WooCommerce is WordPress with a serious e-commerce engine bolted on, and that engine does a lot of work. For every single page view it wakes up PHP, runs your theme and a stack of plugins, makes a pile of database queries, calculates what to show, and only then sends the HTML. For one visitor browsing on a quiet afternoon, that's fine. For a hundred shoppers at once during a promotion, that per-page work becomes the thing that tips your server over.

Shopper PHP + pluginsevery visit DB queries HTML, finally
The red steps repeat on every visit — even for a product page that hasn't changed in weeks.

Here's the thing: that product page hasn't changed in weeks. Rebuilding it from scratch for every visitor is pure waste. Full-page caching saves the finished HTML at the edge and serves that copy directly, so PHP and the database get a break and your shopper gets a page in milliseconds.

The insight: most of your shop is the same for everyone

Walk through your store as a logged-out visitor. The homepage, the category listings, every product page — they look identical no matter who's viewing them. That's the cacheable majority. The only pages that differ per person are the ones tied to a session: the cart, the checkout, and the account area.

Catalog — same for everyone → cache Cart & checkout — personal → bypass
Cache the shared pages, bypass the personal ones. That split is the whole game.

What to cache, and what to bypass

PageCache it?Why
Homepage, categories, productsYesIdentical for every shopper
Search results, blog, CMS pagesUsuallySame content for everyone
CartNeverUnique to the shopper's session
CheckoutNeverLive totals, payment, addresses
My Account / order historyNeverPersonal and private

How the bypass actually works

So how does the edge know whether a request is "just browsing" or "has a cart"? Cookies. The moment a shopper adds something to their basket or logs in, WooCommerce sets specific cookies on their browser. A cache that understands those cookies can make the right call on every request, automatically.

  • A new visitor arrives

    No WooCommerce session cookies yet, so they get the fast, cached catalog page — served from the edge in milliseconds.

  • They add something to the cart

    WooCommerce sets a cart cookie. From now on, the edge sees that cookie and bypasses the cache for them, serving live pages.

  • They check out

    Cart, checkout and account requests skip the cache entirely, so totals, shipping and payment are always live and correct.

  • The cookies that matter are the usual WooCommerce suspects — things like woocommerce_cart_hash, woocommerce_items_in_cart and the logged-in session cookie. You don't have to memorize them: the preset already knows the list.

    The one-click preset

    You could configure all of this by hand — list the cookies, set the bypass paths for /cart, /checkout and /my-account, test every edge case. Or you can pick the WooCommerce accelerator preset, which sets all of it up for you. It knows the cookies, it knows the paths, and it leaves you with a catalog that's fully cached and a checkout that's fully live.

    What you keep

    • Instant product and category pages
    • A live, always-correct cart
    • Logged-in customers see their own prices

    What you drop

    • Per-visit PHP and database load
    • The "is my cache safe?" anxiety
    • Yet another caching plugin to babysit

    Don't forget the product images

    One more win while you're here, because it's often the biggest. A shop lives and dies on its product photos, and those photos are usually the heaviest thing on the page. Converting them to WebP or AVIF and resizing them to the size actually displayed — on the fly, at the edge — frequently does more for perceived speed than any backend change.

    Original photo
    2.0 MB
    Resized + AVIF
    ~180 KB

    A note on Black Friday

    This setup isn't just about everyday speed — it's what lets a small shop survive its biggest day. When traffic goes 10x, cached catalog pages take nearly all of that load off your origin, so your server is free to handle the thing that actually makes money: carts and checkouts. Add an optional waiting room in front, and even a demand spike beyond your capacity becomes an orderly queue instead of a crash.

    ~15ms
    cached product pages
    live cart
    never cached, always correct
    95%+
    of views off your origin
    Bottom line

    "My cart is dynamic" is not a reason to skip caching — it's a reason to cache precisely. Cache the catalog at the edge, bypass the cache for cart, checkout and logged-in sessions using WooCommerce's own cookies, and optimize those product images. You keep every bit of the shop's functionality and lose the sluggishness, all without installing a thing.

    If you want the short path, the WooCommerce CDN setup applies this preset for you, and Site Accelerators covers the same idea for WordPress, PrestaShop and custom platforms.

    #woocommerce #caching #wordpress #ecommerce
    Put it into practice

    See how NordicCDN does this for your site:

    Mads Edelskjold
    Written by
    Mads Edelskjold — Founder, NordicCDN · ex-datacenter CTO

    Mads has worked in IT — mostly hosting — since he was 16. He took an early stake in a SaaS company and helped grow it through to its acquisition by Visma, has built and run data-center networks, and served as CTO of a Danish data center. He started NordicCDN to make fast, secure infrastructure simple to use.

    Make your site load instantly

    Start free in two minutes — no card required.

    Start free