Cart total in header does not work with caching plugin

This topic has 8 replies, 3 voices, and was last updated 7 years, 11 months ago ago by Eva Kemp

  • Avatar: sh70
    sh70
    Participant
    December 1, 2016 at 04:30

    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

    Please, contact administrator
    for this information.
    7 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    December 1, 2016 at 18:51

    Hello,

    We recommend you to use W3 Total Cache plugin https://www.maxcdn.com/one/tutorial/setup-wordpress-with-w3-total-cache/
    Configuring it you need disable “Object Cache” option.

    Please try it.

    Regards,
    Eva Kemp.

    Avatar: sh70
    sh70
    Participant
    December 2, 2016 at 00:51

    Hello,

    here is the answer of Comet Cache regarding your suggestion:

    COMET CACHE ANSWER:
    You can give their suggestion a try and see if that works. Based on what I’m seeing I don’t believe that it will, unless they have done something very specific with that particular caching plugin. Also, I don’t see how Object Caching has any bearing on this whatsoever to be honest. Object Caching should be left off, yes, for an eCommerce site. That’s a good suggestion, but I don’t see it being on or off having any impact on the cart total in the header.

    MY QUESTION:
    I don’t want to change the complete installation without any clue if that will work or not.
    You advertise your theme to be WooCommerce-compatible, so the question about the header-total should not be new for you. And i suppose, that i’m not the only customer who uses caching.
    So, have you any experience in using W3 Total Cache in conjunction with your theme, WooCommerce and especially this “total in header”-problem?

    Thanks!
    Best Regards
    Steffen

    Avatar: Eva
    Eva Kemp
    Support staff
    December 2, 2016 at 09:41

    Hello,

    We fixed the issue with cart totals in the header for W3 Total Cache plugin, that’s why it’s better to use this one.
    Please try it.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: sh70
    sh70
    Participant
    December 2, 2016 at 13:59

    Hello,

    i want to avoid W3 Total Cache, because it breaks the site in 4 of 10 cases (see reviews there!).
    Plus, they have a very bad support there.

    The problem is, that the card total in header is pulled by PHP.
    If this function would be programmed in Javascript, your theme would be compatible with ALL (!!) caching plugins out there.

    Is there a chance to get the function in Javascript? I would even pay for it.
    Because i need a safe site (cached with Comet Cache), but i also need the card total in header.

    Thanks!

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 2, 2016 at 17:07

    Hello,

    In this case it requires additional customization which is beyond our basic support scope but you can order it via this form https://www.8theme.com/customization-services/ .

    Best regards,
    Jack Richardson.

    Avatar: sh70
    sh70
    Participant
    December 6, 2016 at 02:41

    I wrote to customization services, but didn’t get any answer. 🙁

    Avatar: Eva
    Eva Kemp
    Support staff
    December 9, 2016 at 16:17

    Hello,

    Sorry for a delay. Could you please check if the issue persists with default Woocommerce theme Storefront https://woocommerce.com/storefront/ ?
    Also please update the theme to the new version (we’ve sent it to your mail) and check if the problem persists there too. If it does only with Royal theme and works properly with Storefron theme, then provide FTP credentials.

    Please let us know the result.

    Regards,
    Eva Kemp.

  • Viewing 8 results - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.