• Resolved Jacob Hill

    (@tekfused)


    Hello, I have a customer who has LightSpeed Enterprise with WooCommerce installed. Users who are not logged in, everything works great and cached pages are served. When a user logs in, there is no caching. Looking at the logs, I see a message that says this:

    [Ctrl] X Cache_control -> no Cache ( 3rd party woocommerce not cache due to has wc notice ) => LiteSpeed\Control::set_nocache(( 3rd party woocommerce not cache due to has wc notice ))@362 => WP_Hook->apply_filters(,ARRAY)@287 => WP_Hook->do_action(ARRAY)@311

    HTTP response header shows this: x-litespeed-cache-control: no-cache,esi=on

    Any idea how to solve this so that logged in users get cached pages? Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    It should only first time access got no-cache which is due to setting vary , after that it should be cached

    please try refresh a page once or twice , you should see it get cached.

    also make sure you have enabled cache login user

    Best regards,

    Thread Starter Jacob Hill

    (@tekfused)

    Hello!

    I’ve generated a report to help us out here: ZXHBLYWG

    After refreshing the page multiples times, the headers still indicate x-litespeed-cache-control: no-cache,esi=on.

    I have “Cache Logged-in Users” disabled because I want to publicly cache the pages using the vary groups, not cache all pages privately for each user. This worked until recently, not sure when it stopped working.

    Let me know if that helps. I think if we could track down the reasoning for the 3rd party woocommerce not cache due to has wc notice message in the Litespeed debug logs that might help.

    Jake

    Plugin Support qtwrk

    (@qtwrk)

    Your username looks familiar ??

    Do you still in Slack ?

    Thread Starter Jacob Hill

    (@tekfused)

    Thanks for the help!! After researching together, we discovered that the cause was a Woocommerce backend message that was preventing the admin user (not subscribers) from receiving cached pages on the front end.

    After dismissing the Woocommerce alert in /wp-admin/, the pages were cached for my admin user as normal.

    References:

    https://github.com/litespeedtech/lscache_wp/blob/cd965b22668a6c59b96fd3a4066251ebe991fd9d/thirdparty/woocommerce.cls.php#L610

    https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-notice-functions.html

    Hello,

    I have the exact same problem: I have a woocommerce website, for any logged in user the pages are not cached and if I check the logs I have:
    [Ctrl] X Cache_control -> no Cache ( 3rd party woocommerce not cache due to has wc notice ) => LiteSpeed\Control::set_nocache(( 3rd party woocommerce not cache due to has wc notice ))@362 => WP_Hook->apply_filters(,ARRAY)@292 => WP_Hook->do_action(ARRAY)@316

    I need help because I don’t understand what is the actual solution.

    Thank you.

    Thread Starter Jacob Hill

    (@tekfused)

    I don’t believe the issue has been addressed yet. I recently had this pop up again, but was unable to determine which wp-admin Woo alert needed to be cleared to allow caching… So no caching for that site which is crazy!

    Thread Starter Jacob Hill

    (@tekfused)

    I resolved this by commenting out a few lines of code in the following file:

    …/wp-content/plugins/litespeed-cache/thirdparty/woocommerce.cls.php

    
    /*
    elseif ( function_exists( 'wc_notice_count' ) && wc_notice_count() > 0 ) {
    	$err = 'has wc notice' ;
    }
    */

    In my opinion this is a really bad idea. In many cases, there is no way to find the notices that need to be cleared, so no logged in users receive any cached pages indefinitely which obviously cause huge performance issues and makes LS Cache useless.

    @qtwrk, Obviously when I update I’ll have to implement this code change again. Is there any way that this can be addressed?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘LSCache Issue with WooCommerce’ is closed to new replies.