Hi!
First, let me start by saying that I've seen lots of people having issues with their cart and caching, but none of them really matching what what I'm encountering.
When someone adds an item to their cart, the page redirects to the cart and the product appears in the cart like expected. My issue appears when the user returns to a page he already visited before (by clicking on a menu item for example): the cart section with the counter on the top right of the page doesn't update. If he manually reloads the page though, the section is updated.
I thought this was a cache issue and checked with Siteground since they have a specific cache service. But even when we disable all caches systems on their side and I disable every plugin (except Woocommerce) on mine, the issue won't solve itself. So even though it really looks like it, I'm beginning to wonder if it really is a caching issue?
I should mention that I don't have this issue locally.
Is this something somebody ever experienced? Maybe someone else using Siteground?
Thanks for your help.
WC gets cart data from the database per request. What you're describing sounds like browser caching - its not static cache because the refresh would not affect it.
Maybe you have a setup (server or plugin) which adds extra cache headers etc.
Thanks a lot Mike!
It was indeed caused by an Expires Header in my htaccess, the ExpiresDefault one. It obviously shouldn't be used with Woocommerce. Removing it did the trick.
I had the same issue for over 2 months, couldn't figure it out, and this was it! Thank you very much!
Most helpful comment
Thanks a lot Mike!
It was indeed caused by an Expires Header in my htaccess, the ExpiresDefault one. It obviously shouldn't be used with Woocommerce. Removing it did the trick.