• Resolved gilles24

    (@gilles24)


    Hi,

    I am using the Generate Press theme.

    The display of the cart being random in the menu of my site (it appeared sometimes… but not always), I added woocommerce_items_in_cart in the list of exclusions of cookies (cache/tab exclude).

    It works fine (shopping cart now always appears)… except that when a product is added to the cart, the pages are no longer cached, which considerably slows down the loading…

    Is this normal (I thought only the cookie was excluded from the cache, but not the whole page)?

    And if so, is it possible to fix it?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • If you add a cookie to disable cache if this cookie is set, this doesn’t mean that the cookie is not cached. The cookie works like marker and if this marker exists the cache is disabled for all pages. A cookie can’t be cached!

    So remove the cookie from excluding and enable ESI instead.

    Thread Starter gilles24

    (@gilles24)

    I don’t think you understood me.
    In Lite Speed settings, I added this cookie excluding caches (see here: https://i.imgur.com/GPzFTuo.jpeg)
    And on these parameters, it is well marked “Do not cache cookies”! Which means that a cookie is normally cached, if it is not excluded… right?

    And I tested what you say (removing this exclusion and enabling ESI… the page is no longer cached, which is normal… but I still have the problem of cart appearing randomly )

    • This reply was modified 1 year, 8 months ago by gilles24.

    The description of this function is poorly worded. But it is as I have already described. The point of this feature is not that cookies would not be cached, but that the cache is disabled when a specific cookie is set. You cannot cache a cookie.

    Thread Starter gilles24

    (@gilles24)

    Ok, I understand better.
    That the page is therefore not cached with this exclusion is therefore normal (that was my first question…).
    But I am here just applying a recommendation from Lite Speed in case of conflict with woocommerce (https://blog.litespeedtech.com/2017/05/31/wpw-fixing-lscachewoocommerce-conflicts/)… which works …
    My second question is “how to fix this?”, knowing that I tried what you say… but it doesn’t work (with ESI, cart appears randomly in my menu… so I come back to the starting point…)

    As described in the blog post on the LiteSpeed Blog, there is no real solution to this problem. LiteSpeed is basically compatible with WooCommerce, but there are themes where compatibility cannot be fully guaranteed. Apparently you have such a theme, which is why the solution can only be that the cache is deactivated as soon as a customer puts an item in the shopping cart. If this is the case, WooCommerce creates cookie “woocommerce_items_in_cart”. This cookie name must then be entered as an exclusion criterion in the cache plugin settings. This ultimately means that once a customer has added an item to their cart, the cache is disabled for all pages.

    Thread Starter gilles24

    (@gilles24)

    Ok…

    I will therefore see this with the developers of the theme.

    Thanks

    Hello,

    I just came here to ask the exact same question, can you guys please do a real solution to this problem ?

    Thanks in advance

    I just came here to ask the exact same question, can you guys please do a real solution to this problem ?

    Did you read this? https://blog.litespeedtech.com/2017/05/31/wpw-fixing-lscachewoocommerce-conflicts/

    Yes i did

    If you add a cookie to disable cache if this cookie is set, this doesn’t mean that the cookie is not cached. The cookie works like marker and if this marker exists the cache is disabled for all pages. A cookie can’t be cached!

    This is the main problem, once i added the cookie to exclusion tab, the website become VERY slow due to cache status is no-cache

    Please guys try to do a real solution!

    Please guys try to do a real solution!

    Did you try ESI?

    Did you try ESI?

    Yes and didn`t work as well

    If ESI did not lead to a solution in your case either, then you are one of the few of the 4 million cache plugin users for whom there is no solution. Although the cache plugin provides very flexible solutions. The problem is your theme. That’s why there are really only 2 solutions. Change the theme or allow the cache to be disabled as soon as a user puts an item in the shopping cart.

    There would certainly be other solutions, but such other solutions are not feasible with the cache plugin.

    Thread Starter gilles24

    (@gilles24)

    Hi CacheCrawler,
    You claim that the problem is the theme… but my theme developers (Generate Press) tell me this: “All the theme does is make the function callback to display the Woocommerce mini cart ( which is a woo function ). We don’t control what it does or how caches interact with it.
    What is the issue that Litespeed thinks is theme related?“.
    I would appreciate an answer from Lite Speed support…

    Plugin Support qtwrk

    (@qtwrk)

    by any chance , did you enable “Enable AJAX add to cart buttons on archives” ?

    ideally for the cart , the theme should do an ajax call to update it

    Thread Starter gilles24

    (@gilles24)

    Hello qtwrk,
    Yes, “Enable AJAX add to cart buttons on archives” was checked.
    I unchecked it, and I deleted the cookie exclusion… and the display of the basket becomes random again…
    But I was previously using Side Cart plugin with ajax add to cart feature. I removed the xoo-wsc options… But the display of the basket remains random.
    As I’m not sure I understand, I rechecked the ajax option in the woocommerce settings… But still the initial problem of random cart display.
    I unchecked the browser cache…still the same.
    But can you be more clear: should I enable Ajax add to cart on archives or not?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Cookie woocommerce_items_in_cart exclusion slow down website’ is closed to new replies.