Search Knowledge Base
Table of Contents
< Go Back To Home
Print

Fixing Compatibility Issues Between LiteSpeed Cache and WooCommerce

Introduction

LiteSpeed Cache is a popular caching plugin that can help improve the performance of your WordPress website. However, it can sometimes cause compatibility issues with other plugins, such as WooCommerce.

One common compatibility issue occurs when using themes that have Ajax carts. Ajax carts allow users to add items to their cart without having to refresh the page. However, this can cause the shopping cart to update incorrectly when LiteSpeed Cache is enabled.

How to Fix the Compatibility Issue

The solution to this compatibility issue is to add a cookie to the LiteSpeed Cache do not cache list. This cookie instructs LiteSpeed Cache to not cache the shopping cart page.

Here’s how to do it:

  1. Login to your WordPress dashboard.
  2. Navigate to LiteSpeed Cache > Configuration.
  3. Click on the Cache tab.
  4. In the Exception section, add the following line:
{nocache="yes"}?wc_ajax=cart**

Alternativery, In your WordPress Admin, go to LiteSpeed Cache > Settings > Do Not Cache Rules.

Under Cookie List, enter woocommerce_items_in_cart, scroll down and press Save Changes.

  1. Click on the Save button.

This will add a cookie to the LiteSpeed Cache do not cache list for any URL that contains “?wc_ajax=cart”. This will prevent LiteSpeed Cache from caching the shopping cart page, which will fix the compatibility issue.

Conclusion

By following these steps, you should be able to fix the compatibility issue between LiteSpeed Cache and WooCommerce. If you are still having trouble, you can contact LiteSpeed Tech support for further assistance.