LiteSpeed settings for SureCart

I have been using SureCart for just over a year now. I have always had issues with LiteSpeed caching and the cart.

Finally, a user in the SureCart Facebook group gave a clear list of settings to configure for SureCart with the LiteSpeed plugin for WordPress.

Updated 01/2026

The brief steps are:

How to setup Litespeed cache for Surecart
1. Under Cache -> Cache - set Cache REST API to OFF
2. Under Cache -> Excludes - add the below under Do Not Cache URIs
/wp-json
/checkout
/customer-dashboard
/shop

Optional:
/login
/wp-login
/register
/my-account
/cart

3. Under Cache -> Browser - set Browser Cache to OFF
4. Under Page Optimization -> JS Settings - set JS Combine to OFF
5. Under Page Optimization -> Tuning - add the below under JS Deferred / Delayed Excludes
api-fetch.min.js
a11y.min.js
i18n.min.js
url.min.js
dom-ready.min.js
hooks.min.js

This is very important as you will get weird errors where cart items disappear, shop buttons don’t work etc.

Complete LiteSpeed Cache Configuration for SureCart

Step-by-Step Configuration Guide

Follow these steps carefully to ensure SureCart works perfectly with LiteSpeed Cache.


1. Cache Settings – Disable REST API Caching

Navigation: LiteSpeed Cache → Cache → Cache

Setting: Cache REST API Value: OFF

Why: SureCart uses WordPress REST API for dynamic content (customer data, cart, checkout). Caching these requests causes outdated information and broken functionality.


2. Cache Excludes – Exclude Dynamic Pages and API Routes

Navigation: LiteSpeed Cache → Cache → Excludes

Setting: Do Not Cache URIs Add these lines (one per line):

/wp-json
/checkout
/customer-dashboard
/shop

Optional – Add if you have these pages:

/login
/register
/my-account
/cart

Why: These pages contain user-specific, real-time data that should never be cached. Login and account pages need to display current user information.


3. Browser Cache – Disable Browser Caching

Navigation: LiteSpeed Cache → Cache → Browser

Setting: Browser Cache Value: OFF

Why: Aggressive browser caching can cause customers to see stale cart data, old prices, or outdated order information. This data cannot be cleared remotely, creating serious transaction issues.


4. JavaScript Optimisation – Disable JS Combining

Navigation: LiteSpeed Cache → Page Optimisation → JS Settings

Setting: JS Combine Value: OFF

Why: In HTTP/2 environments, combining JavaScript files is unnecessary and can break functionality. HTTP/2 allows parallel loading, making the combination redundant.


5. Core WordPress Scripts – Prevent Deferring Critical Scripts

Navigation: LiteSpeed Cache → Page Optimization → Tuning

Setting: JS Deferred Excludes (or JS Delayed Excludes – add to both if both options exist)

Add these scripts (one per line):

api-fetch.min.js
a11y.min.js
i18n.min.js
url.min.js
dom-ready.min.js
hooks.min.js

Why: These core WordPress scripts are essential for dynamic functionality and accessibility. They must load synchronously. Deferring them breaks SureCart’s checkout, cart updates, and customer interactions.


6. Save and Clear Cache

After making all changes:

  1. Click Save Changes on each settings page
  2. Navigate to LiteSpeed Cache → Toolbox → Purge
  3. Click Purge All to clear all cached content
  4. Test your site thoroughly

Testing Checklist

After configuration, test these critical functions:

  • Add products to cart
  • Update cart quantities
  • Proceed to checkout
  • Complete a test order
  • Log into customer dashboard
  • View order history
  • Log out and log back in
  • Test on different browsers
  • Test in incognito/private mode

Quick Reference Summary

Setting LocationSetting NameValue
Cache → CacheCache REST APIOFF
Cache → ExcludesDo Not Cache URIs/wp-json, /checkout, /customer-dashboard, /shop
Cache → BrowserBrowser CacheOFF
Page Optimisation → TuningJS CombineOFF
Page Optimization → TuningJS Deferred/Delayed Excludesapi-fetch.min.js, a11y.min.js, i18n.min.js, url.min.js, dom-ready.min.js, hooks.min.js

Troubleshooting

If checkout still doesn’t work:

  1. Clear LiteSpeed cache completely
  2. Clear your browser cache
  3. Test in incognito/private mode
  4. Check browser console for JavaScript errors

If cart doesn’t update:

  1. Verify REST API caching is OFF
  2. Confirm /wp-json is in Do Not Cache URIs
  3. Clear all caches and test again

If customer dashboard shows wrong data:

  1. Confirm /customer-dashboard is excluded from caching
  2. Verify Browser Cache is OFF
  3. Test after clearing all caches

Additional Notes

  • HTTP/2: Modern hosting uses HTTP/2, which makes file combining obsolete
  • Cache Warmup: If using LiteSpeed’s cache warmup feature, ensure excluded pages aren’t included
  • Mobile Cache: If you have separate mobile cache enabled, these settings apply to both desktop and mobile
  • Testing: Always test thoroughly after changes, especially checkout and payment processing

Similar Posts