- AuthorPosts
- August 30, 2023 at 12:13 pm #103334KevinGuest
Hello,
I’ve installed this plugin in a development setting for my WordPress site and it’s very fast.
The only issue I currently still have is that it is caching certain things that should not be cached, namely the mini cart and the logged in status both in my header.Going to the actual checkout page has the right cart items but the mini cart in my header often shows as either empty or not having all items (I’m using WooCommerce btw if that changes anything).
Also in my header it’s supposed to show you’re name if you’re logged in but since the header is I guess cached it just always shows the login button unless going to a page that had not been cached yet.
I thought about just not caching the header php file at all but it’s where all my CSS and some JS is loaded in so that would defeat a lot of the purpose of the plugin. Any idea how I could fix this? The plugin gives my website a much needed performance boost and this is the only thing keeping me from using currently.
Regards,
KevinAugust 30, 2023 at 12:21 pm #103392Marko VasiljevicKeymasterHello Kevin,
Thank you for reaching out and I am happy to assist you with this.
If convenient, can you please share your website URL?
In the Woocommerce settings, there should be a setting to Ajax add to cart for WooCommerce. This will bypass the cache and load the cart dynamically with W3 Total Cache.
Also, check if the cache control and expires header is set for the HTML&XML section in Performance>Browser Cache and disable it, save all settings, and purge the cache.
Make sure that the option “Don’t cache pages for logged-in users” is enabled in Performance>Page Cache.Let me know if this helps!
Thanks!
August 31, 2023 at 12:06 pm #103491KevinGuestHello,
I’ve heard a lot of people online mention the WooCommerce setting to add items to cart via AJAX but sadly it doesn’t seem to exist. I’ve looked where people say it should be and everywhere else but the only similar setting I can find (which should be in the same place the setting you mentioned is) is called “Enable AJAX add to cart buttons on archives” but this doesn’t help with product pages, that option is enabled though. If you know why the setting might not be showing up that would be really nice.
The only one of the W3 Total Cache settings that wasn’t set to what you recommend was disabling ‘cache control’ which seems to work, as far as I can tell right now. We’ll do some more testing next week to make sure everything works as intended now but if you don’t hear from me again then thanks for the help!
Regards,
Kevin - AuthorPosts
- The topic ‘How to prevent certain header items from caching’ is closed to new replies.