Hello,
i want to use a caching plugin to speed up my site.
The problem is the header of the Royal Theme with it’s WooCommerce total.
The total in header does not work together with caching plugins.
Please read the conversation i had with Comet Cache (caching plugin):
COMET CACHE ANSWER:
I’m not seeing a problem with Comet Cache or with configuration though, it just seems that you have a component there in the header that is not cache compatible; i.e., the cart total is not filled via JavaScript for cache compatibility, it is generated via PHP on the server-side, which means that every page on the site is prone to miscalculation when you enable caching, because the cart total is generated via PHP and is subject to change for any given user. For example, whoever hits the page first, decides what the total will be for all others that come later; i.e., the cart total is cached at $0.00 for many users, and therefore when you add an item and return to a page that was already cached, the total is off. Please see: Is Comet Cache compatible with E-Commerce plugins (such as WooCommerce)?
MY ANSWER:
Thanks so far!
I have further questions.
1)
Why is the total in header working properly on other pages? If the component in the header would be not compatible, then the total would be wrong on all pages.
But it’s only wrong on start page.
2)
What can i do to make comet cache working? I have to use a caching plugin.
Do you have any suggestions?
COMET CACHE ANSWER:
It’s not. That is, it may only impact the home page in some tests, just depending on the amount of traffic you have on the site, but the problem can show itself on any page of the site where that cart total is shown. Whoever fills their cart and lands on any given page of the site first, establishes the total that is shown and cached for that particular page. In other words, a visitor coming later will see the old total that was shown to the previous user, because the old total was already cached as a result of another user hitting that page first.
Hence, that cart total being ‘dynamic’ makes it incompatible with caching.
Way to resolve this:
Replace that component with another one. One that pulls the total via JavaScript. Making it cache compatible.
So, what can we do here? I really need a caching plugin but i also need the functionality of the cart total in header.
Thanks for a fast help!
Best Regards
Steffen