• Resolved Gal Baras

    (@galbaras)


    When I change the status of a WooCommerce order, I see the notice “Notified LiteSpeed Web Server to purge all LSCache entries.” although orders are not displayed at the front end and they shouldn’t be cached at all.

    The Purge tab only provides a setting for WHAT to purge, but not under what conditions to do it.

    This can cause an active store site to be uncached most of the time, which is definitely not a good thing.

    Also, pages should be purged from cache if they are related to the page that’s changed. So if I change a post, there’s no reason to purge the main shop page, but if I change a product, the shop page may need to change too.

    This can be achieved using post-type-based purge settings.

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

    (@qtwrk)

    Hi,

    I just set up a wooc site for test , but when I change the order status , like from “processing” to “on hold” , “pending payment” or “completed”.

    I don’t see that purge all lscache entries message , also my front page still showing cache: hit

    Could you please specifies the steps how to trigger/reproduce the issue ?

    Best regards,

    Thread Starter Gal Baras

    (@galbaras)

    I just edit an order, change the status and save.

    I have the following settings:

    • Cache: only “Favicon” and “PHP”
    • Purge: “Purge All On Upgrade” and “All”
    • Excludes: “Query Strings” is “nocache” and “Role Excludes” is “Administrator, SEO Manager”
    • Optimise: everything checked
    • Tuning: “CSS Excludes” is “woocommerce-smallscreen.css”, “URI Excludes” is “nocache” and “Role Excludes” is “Administrator”
    • WooCommerce: “Product Update Interval” is set to “Purge product only when the stock status changes. Do not purge categories on changes to the quantity or stock status.”
    • All other settings are disabled

    In WooCommerce, stock management is enabled, and some products have stock management turned on, but I’ve tested with an order for a digital variation, where the “Enable stock management at product level” is OFF and the variation’s “Manage Stock” is also OFF.

    Looks like the plugin might not be checking whether stock levels are actually being changed. Unfortunately, there’s no option to disable purge for products, so I can’t verify this.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    OK , could you please enable the advance debug log to your IP, then try same process, the log should record the purge tag ,let’s see what it calls to purge.

    Best regards,

    Thread Starter Gal Baras

    (@galbaras)

    
    [Purge] added * => LSC_Purge->_add()@332 => LSC_Purge->_purge_all_lscache()@178 => LSC_Purge::purge_post()@676 => WP_Hook->apply_filters()@288 => WP_Hook->do_action()@312 => 
    /home/gboldev/public_html/behappyinlife/wp-includes/post.php@478 => 
    /home/gboldev/public_html/behappyinlife/wp-content/plugins/flamingo/includes/class-contact.php@4081 => Flamingo_Contact->save()@166 => Flamingo_Contact::add()@122
    
    
    X-LiteSpeed-Purge: public,528_
    
    
    X-LiteSpeed-Purge: public,stale,528_
    
    Thread Starter Gal Baras

    (@galbaras)

    In debug.purge.log:

    
    X-LiteSpeed-Purge: public,stale,528_ => LSC->send_headers()@680 => WP_Hook->apply_filters()@288 => WP_Hook->do_action()@312 => 
    /home/gboldev/public_html/behappyinlife/wp-includes/load.php@478
    
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    LSC_Purge->_purge_all_lscache()@178 => LSC_Purge::purge_post()

    purge post leads to purge all action.

    Purge: “Purge All On Upgrade” and “All”

    if you checked “all” in purge setting , then any action will leads to purge all.

    please uncheck this action.

    Best regards,

    Thread Starter Gal Baras

    (@galbaras)

    For “Auto Purge Rules For Publish/Update”, the admin page states “Select which pages will be automatically purged when posts are published/updated”.

    Looks like when I select only “Recent Posts widget”, “Post type archive” and “Term archive”, the purge isn’t triggered on order save.

    WooCommerce orders are not posts, though. Is “All” not the same as ticking all the other checkboxes?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Is “All” not the same as ticking all the other checkboxes?

    well , under the hood , it’s different , all will use * for all , while if you check all other checkboxes , it will send individual tag for selected page.

    Best regards,

    Thread Starter Gal Baras

    (@galbaras)

    Going back to the original issue, WooCommerce orders should be handled using the WooCommerce extension related to inventory level changes. They should not be considered a post type that triggers purging otherwise.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I was discussing with our developers about this topic.

    Could you please clarify what exactly is your ideal way for purge workflow ?

    for example: when order-status-change should not trigger any purge UNLESS this product is sold-out ?

    Best regards,

    Thread Starter Gal Baras

    (@galbaras)

    My view is that the only impact orders may have on the site’s front end is through changes to stock levels that are actually shown.

    1. Some sites don’t have inventory management turned on. On such sites, order status makes no difference, so either detect this automatically in the WooCommerce settings or provide a way to disable purging on stock level change
    2. Some sites have inventory management turned on, but stock levels are only displayed on single product pages, not product archives. On such sites, there should be a way to choose what to purge on stock level changes
    3. Some product types (virtual, downloadable) don’t have inventory management turned on. Some specific products may also have it turned off. If an order only contains such products, there is no need to purge anything. If the plugin can detect stock level changes, it should only purge when stock levels actually change
    4. Order status changes may affect other pages via certain WooCommerce shortcodes/blocks, so the plugin should provide an option for purging pages containing those shortcodes/blocks

    I hope this helps (and I hope it covers everything).

    It may be good to reach out to the WooCommerce team, just in case.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Cache purge triggered on WooCommerce order status change’ is closed to new replies.