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.jsThis 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
/shopOptional – Add if you have these pages:
/login
/register
/my-account
/cartWhy: 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.jsWhy: 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:
- Click Save Changes on each settings page
- Navigate to LiteSpeed Cache → Toolbox → Purge
- Click Purge All to clear all cached content
- 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 Location | Setting Name | Value |
|---|---|---|
| Cache → Cache | Cache REST API | OFF |
| Cache → Excludes | Do Not Cache URIs | /wp-json, /checkout, /customer-dashboard, /shop |
| Cache → Browser | Browser Cache | OFF |
| Page Optimisation → Tuning | JS Combine | OFF |
| Page Optimization → Tuning | JS Deferred/Delayed Excludes | api-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:
- Clear LiteSpeed cache completely
- Clear your browser cache
- Test in incognito/private mode
- Check browser console for JavaScript errors
If cart doesn’t update:
- Verify REST API caching is OFF
- Confirm /wp-json is in Do Not Cache URIs
- Clear all caches and test again
If customer dashboard shows wrong data:
- Confirm /customer-dashboard is excluded from caching
- Verify Browser Cache is OFF
- 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




