Site logo

Archived topic

Litespeed Cache breaks Menu Cart

9 replies · Started by Gilles on March 9, 2023

Viewing posts 1–10 of 10

Hi
I have integrated your code (https://docs.generatepress.com/article/hide-cart-in-menu-when-empty/) to not display the cart in the menu if it is empty.
it works. But I have a small problem, probably related to the cache system I use (Lite speed cache).
Indeed, after an addition to the basket, if I return to a page previously displayed (before the addition), the basket does not appear in the menu.
I guess I need to exclude the menu (or just the cart widget ?) from cache menu?
If so, please tell me how to proceed?

I can confirm that it's a caching issue. You can test this out by adding /?nocache at the end of your URL.

What caching are you using? It would be best to check with them regarding this. It would also be good to check if your Hosting Provider has some caching enabled on your site as well.

I use Lite Speed Cache.
But their support is almost non-existent... and I know in advance that they will refer me to you...
There is no server-side caching.

Hi there,

does the cart work as expected without the LS Cache plugin enabled ?

Hello David,
Yes of course. By the way, caches are disabled on the Shopping Cart page.

I had a look around for some answers, seems other users have had similar issues, but most LS support topics or docs bare no resemblance to the plugin today. And i am not familiar with it aside from the issues that it causes some users.

A couple of docs recommend:

Litespeed -> Cache -> Excludes --> Do Not Cache Cookies and add this: woocommerce_items_in_cart

To stop it caching cookies.

Give that a try.

It works !
Thank you very much.

Wow - i am so glad to hear that :)

This archived topic is closed to new replies.