Litespeed Cache with Woocommerce


Litespeed Cache is one of the best caching plugin on wordpress but sometimes it makes things worse on wordpress website. On this post we are going to talk about how we can make it work with woocommerce.

Known Issues

  1. Cart Items Count getting cached.
  2. Add to Cart using Ajax doesn’t work.
  3. Woocommerce Pages getting cached (like My Account, Cart, Checkout and Thank You Page).

Fix Cart Items Count getting Cached

  • Go to Litespeed Cache (Dashboard) >> Cache
Litespeed Cache Menu on Dashboard
  • Open Excludes Tab and Scroll down to “Do Not Cache Cookies” Field
  • Write “woocommerce_items_in_cart” in the Field and Clear Cache
Do Not Cache Cookies Field

Fix Add to Cart using Ajax

  • Go to Litespeed Cache (Dashboard) >> Cache
    • Disable Cache Rest API
    Rest API Option

    Fix Woocommerce Pages

  • Go to Litespeed Cache (Dashboard) >> Cache
  • Open Excludes Tab and Scroll down to “Do Not Cache URIs” Field
  • and add:

    /cart
    /checkout
    /my-account/$
    /order-received/$
    /order-pay/$
    Do Not Cache URIs Field

    These three steps will make your woocommerce fast and stable using Litespeed Cache with no more cache issues.

    ,

    Leave a Reply

    Your email address will not be published. Required fields are marked *