LiteSpeed LSCache + OpenCart (Journal3): Mini cart shows wrong item count on cached pages (random / 0 items)

#1
Hi all,

I’m running OpenCart 3.x with the Journal3 theme on LiteSpeed Web Server (LSWS) with LSCache enabled. I’m trying to properly cache public pages (home, category, product pages) while keeping the mini cart (header cart) dynamic per user.

Problem:
When LSCache is enabled, the mini cart shows incorrect values on cached pages:
  • Sometimes it shows 0 items
  • Sometimes it shows 1 or 3 items randomly
  • On the first visit to a page it may show the correct value, but when navigating back to the homepage (which is cached), the mini cart shows old/wrong values
  • This causes inconsistent cart behavior and even prevents cart updates from reflecting correctly on cached pages

Current setup:
  • LiteSpeed Web Server Enterprise
  • LSCache enabled (public cache for HTML pages)
  • Private cache enabled
  • OpenCart 3.x
  • Journal3 theme
  • LSCache OpenCart extension enabled
  • ESI Modules configured, e.g.:
    • common/cart → ESI with private cache
    • common/cart/info → ESI with private cache
    • journal3/cart → ESI with private cache
  • Cart/checkout/account pages are excluded from cache via .htaccess and LSCache settings

Symptoms / Findings:
  • Cached pages (x-litespeed-cache: hit) show outdated cart data in the header
  • The mini cart fragment sometimes appears to be cached as part of the full page
  • In some cases admin messages (like “Success: You have modified LiteSpeed Cache extension”) appeared on frontend cart pages, indicating private/admin content leaking into public cache
  • Disabling LSCache fixes the problem immediately

What I suspect:
  • The mini cart fragment is not being consistently served as ESI private cache
  • Possibly the Journal3 mini cart endpoint is different from the default common/cart route
  • Or LSCache is not correctly separating public cache and private cache for cart fragments

Question:
What is the correct and recommended setup for:
  • LSCache + OpenCart
  • Journal3 mini cart
  • ESI (Edge Side Includes) for cart fragments

Specifically:
  • Which exact routes should be configured as ESI private cache for Journal3 mini cart?
  • Are there known issues with Journal3 + LSCache where the header cart is still rendered into the full page cache?
  • Is there a best-practice config for OpenCart + LSCache to avoid cart/session leakage into public cache?
Any guidance or working examples would be highly appreciated.

rijstextiles.eu is the test website where you can try out the issue.

Thanks in advance!
 
Top