Wordpress LScache Plugin: Mini cart is cached ? same cart contents for multiple users
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hey there, I have a strange bug with my mini-cart: Litespeed completely ignores that the cart serves dynamic content. This is what I am doing to encounter this bug: ? cache purged ? I visit my website ?> empty cart cache created ? I add product A to the cart ?> non-empty cart cache created ? I add product B to the cart ?> I get the non-empty cart cache served ? just product A in the mini-cart ? I open the website in another browser (completely new session) and add product C to the cart ? surprise: even in the new session is just product A However, this strange behavior is just in the mini-cart. The real cart shows the products correctly. I have ESI enabled, but maybe Litespeed doesnt recognize the mini-cart correctly? What can I do to fix this bug? Thank you very much in advance! PS: Litespeed is GREAT! The page I need help with: https://kunst-aber-witzig.de/product-category/kunstdrucke/ Hi, please try add this at top of your .htaccess RewriteRule . - [E=Cache-Vary:woocommerce_cart_hash] then purge all Best regards, Hey qtwrk, thanks for your reply! I just tried that. The mini-cart is now always correct, BUT the pages are not cached anymore. Every time I add a new product to the cart I get served an uncached website. I was hoping to make it work with ESI? In the meantime I also figured that the Mini-Cart DOES get updated ? but just on shop pages (products and archives). Is this expected behaviour? Id love to show the correct cart also on static pages to not confuse users. Hi, to make it work with ESI, you may need to do some custom coding to make it ESI block there are 3 ways to this case 1. cache vary , which makes what you have said , once items in cart, it will generate new cache , simplest and also less efficient 2. use ajax call to update cart , this is most suitable solution , but not every mini-cart or theme works that way 3. make it work with ESI , this will probably the hardest one as it requires custom coding Best regards, Thanks! The strange thing is: apparently it DOES work with ESI ? but just on shop and product pages. Could that be? if theme loads mini cart , differently , on product/shop page, it could be? but that must be weird I think. Any suggestion how I could check if ESI is loading the cart? use the debug log , if its ESI request, you will see log shows entries with URIs like /?lsesi=xxxxxxxx
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference