LiteSpeed

LiteSpeed Cache for WooCommerce: settings for a fast, safe shop

Configure LiteSpeed Cache for WooCommerce stores: what is cached, cart and checkout exclusions, ESI for mini carts, stock updates and settings to avoid.

IntermediateWordPress on LiteSpeed3 min read

Online shops gain the most from caching: fast product pages convert better. They also have the most to lose if caching goes wrong, such as one customer's cart showing to another. The LiteSpeed Cache plugin understands WooCommerce, so the defaults are safe. This guide explains what happens and which settings to adjust.

Before you start

What LiteSpeed Cache does for WooCommerce automatically

  • Shop, category and product pages are cached for guests.
  • Cart, checkout and My Account pages are never cached.
  • When a visitor adds an item to the cart, WooCommerce sets a cookie and LiteSpeed serves that visitor uncached or private pages, so carts are always correct.
  • Product pages are purged automatically when you edit a product or stock changes.

Check the WooCommerce settings

Go to LiteSpeed Cache → Cache → WooCommerce (shown when WooCommerce is active).

SettingRecommendedWhy
Product Update IntervalPurge product and categories only when stock status changesAvoids purging on every sale while keeping "out of stock" accurate.
Use Front Page TTL for the Shop PageOn if the shop is your home pageKeeps the shop page fresh.
Privately Cache CartOnLogged-in or cart-holding visitors get a private cached copy.

ESI for mini carts and personal widgets

Edge Side Includes (ESI) let LiteSpeed cache a page publicly while punching holes for personal parts, such as the mini cart in the header or a "Hello, name" greeting. Turn it on in LiteSpeed Cache → Cache → ESI with Enable ESI set to On. It works best with themes that use standard WooCommerce widgets.

Note: ESI is a LiteSpeed Enterprise feature. MdmHost servers run LiteSpeed Enterprise, so it is available.

Settings to treat carefully

  • Cache Logged-in Users: safe with WooCommerce because personal pages are excluded, but test My Account and order pages.
  • JS Delayed (Page Optimization): can break add-to-cart buttons, variation selectors and payment scripts. Exclude WooCommerce and payment gateway scripts (see page optimisation).
  • Do Not Cache URIs: add custom checkout steps or payment callback URLs from plugins.

Test the shop

  1. In a private window, open a product page and check for x-litespeed-cache: hit in the response headers on the second load.
  2. Add the product to the cart. The cart page should show the product, and the header mini cart should update.
  3. Open a second browser; its cart should be empty.
  4. Complete a test order and confirm stock decreases on the product page.

Troubleshooting

Mini cart shows the wrong count

Enable ESI, or exclude the theme's cart fragment from JS optimisation. Purge all afterwards.

Prices or currency do not change per visitor

Currency switcher plugins need a cache vary. Add the plugin's cookie name in Cache → Excludes → Do Not Cache Cookies or use its LiteSpeed integration.

Checkout is slow

Checkout is never cached, so speed depends on PHP and the database. Use a recent PHP version (see changing PHP version).

Frequently asked questions

Can customers see each other's carts?

Not with the default rules. Visitors with a cart cookie never receive the shared cached page. Problems only appear when custom rules override the defaults.

Should I use the crawler on a large shop?

Only if your plan has spare resources. On shared hosting, a crawler on thousands of products can hit CloudLinux limits; limit it to key pages.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.