Skip to main content

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

FeatureWhy It HelpsTypical Metrics
Critical CSS (CCSS)Reduces render-blocking CSS for first paintLCP/FCP
Guest ModeMakes first-time visits faster by reducing session overheadTTFB/LCP
Guest OptimizationApplies certain optimizations early for guestsLCP/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)
  1. Enable Guest Mode and Guest Optimization.
  2. Enable Critical CSS (test carefully; CCSS can introduce layout issues).
  3. Keep LSCache JS optimization features off if Perfmatters owns JS.
  4. 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

IssueLikely CauseFix
CLS increases after enabling CCSSCCSS not accurate for that templateUse per-URL CCSS (if available), adjust CSS exclusions, or disable CCSS
Cart widget shows stale countsCached fragments without ESI/bypass rulesConfigure ESI for the cart fragment or exclude that route
JS delay stops working for guestsOverlapping optimization layersEnsure only one tool controls delay/defer; purge caches

What's Next