LSCache Fallback
If you run LiteSpeed/OpenLiteSpeed, LiteSpeed Cache (LSCache) can still help with resource delivery even when page cache is bypassed (logged-in sessions, cart/checkout, cache misses). The key is to avoid overlapping optimizations between LSCache and other tools like Perfmatters.
note
This page assumes you are using LiteSpeed/OpenLiteSpeed with the LSCache plugin. If you're not on LiteSpeed, skip this page.
Division of Labor (Avoid Conflicts)
Pick a single owner for each category:
- JavaScript execution control (defer/delay/unload): Perfmatters (recommended in this curriculum)
- HTML page caching + ESI: LSCache
- Critical CSS / unused CSS: choose one tool (LSCache or a separate CSS optimizer) and test
caution
Do not run multiple JS minify/defer/delay systems at the same time. It is a common cause of broken menus, broken checkout, and hard-to-debug race conditions.
LSCache Features That Matter Here
| Feature | Why It Helps | Typical Metrics |
|---|---|---|
| Critical CSS (CCSS) | Reduces render-blocking CSS for first paint | LCP/FCP |
| Guest Mode | Makes first-time visits faster by reducing session overhead | TTFB/LCP |
| Guest Optimization | Applies certain optimizations early for guests | LCP/INP |
Where to Configure
LSCache UI locations vary by version, but you will typically find these under:
LiteSpeed Cache -> Page Optimization(CSS/JS and CCSS options)LiteSpeed Cache -> General / Tuning(Guest Mode / Guest Optimization)
Recommended Starting Approach
- Enable Guest Mode and Guest Optimization.
- Enable Critical CSS (test carefully; CCSS can introduce layout issues).
- Keep LSCache JS optimization features off if Perfmatters owns JS.
- Re-test (logged-out) and validate LCP/CLS.
Validation
- Confirm cache headers (
x-litespeed-cache, etc.) for public pages. - Confirm above-the-fold styling renders quickly and consistently.
- Verify no new CLS issues were introduced.
- Test key flows (cart/checkout/account) and ensure caching rules/ESI are correct.
Troubleshooting
| Issue | Likely Cause | Fix |
|---|---|---|
| CLS increases after enabling CCSS | CCSS not accurate for that template | Use per-URL CCSS (if available), adjust CSS exclusions, or disable CCSS |
| Cart widget shows stale counts | Cached fragments without ESI/bypass rules | Configure ESI for the cart fragment or exclude that route |
| JS delay stops working for guests | Overlapping optimization layers | Ensure only one tool controls delay/defer; purge caches |