• Resolved cnlselectronics

    (@cnlselectronics)


    Hello,

    We have Litespeed Cache plugin all set up and working well. We also have the option selected to purge stock/categories when the stock or stock status changes. The setting selected is “Purge product on changes to the quantity or stock status. However, we use a FTP plugin that pulls stock from a supplier every couple of hours, when the stock is changed via FTP it doesnt show out of stock until you attempt to add it to the basket.

    Should our option be “Always purge both product and categories on changes to the quantity or stock status” ? OR is there a snippet we can add to functions to run cache on the product change – bear in mind we have almost 4,000 items that may (or may not) have stock changes at once when the stock is updated.

    Thanks

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

    (@qtwrk)

    it depends on how your other plugin works and updates stock , if it’s not using wp/wc standard hook , our plugin may not be made aware of the change to fire auto-purge

    you can try hook our purge call to your other plugin when pulls stock

    do_action( 'litespeed_purge_post', $product_id );
    Thread Starter cnlselectronics

    (@cnlselectronics)

    Thank you, this actually caused issues on server due to the large amount. however, we have worked a separate solution for this issue. We still use Litespeed on the rest of the site.

    There is no option in Litespeed Cache settings to turn off Woocommerce caching in the 4 options in the plugin. Would you be able to tell me how we can disable caching on product pages/ category pages completely please?

    Plugin Support litetim

    (@litetim)

    @cnlselectronics
    Try something like:
    if(is_product()){ define('DONOTCACHEPAGE', true); }
    Add to hook init(maybe try to a later hook).
    Other conditional functions: https://developer.woocommerce.com/docs/conditional-tags-in-woocommerce/

    But doing this will beat the usefulness of cache.
    Except what cache do(as a system), LSC will only add functions(hooks) that clear cache in some conditions: change quantity, change price.

    • This reply was modified 1 year, 4 months ago by litetim. Reason: fix code formatting
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WooCommerce Stock Cache’ is closed to new replies.