Woocommerce product update interval




Wordpress LScache Plugin: Woocommerce product update interval

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, Is there any option to purge product and category pages for product prices updates as quantity updates on Cache > Woocommerce > Product Update Interval settings? Thank you! How exactly did you update the price ? Hello, The price and quantities are updated with REST API. Therefore, page cache is not updated during price revisions. Regards please try add this to themes functions.php add_action(woocommerce_update_product, lscwp_purge_product_update, 10, 2) function lscwp__purge_product_update($product_id, $product) if (defined(LSCWP_V)) do_action( litespeed_purge_post, $product_id ) Thank you! It works There is a typo in the function name. Also, can I purge category pages of that product? Regards oops , didnt notice yes , but it will be bit of complicated you need to get the category name/id based on product id , then purge it add this into function $lscwp_categories = wp_get_post_categories( $product_id , array( fields => all ) ) if( $lscwp_categories ) foreach($lscwp_categories as $lscwp_c) if (defined(LSCWP_V)) do_action( litespeed_purge_url, get_category_link( $lscwp_c ->term_id ) ) didnt try , but I think it should works ? Thank you! Unfortunately, the category cache is not updated. My final code is: add_action(woocommerce_update_product, lscwp_purge_product_update, 10, 2) function lscwp_purge_product_update($product_id, $product) if (defined(LSCWP_V)) do_action( litespeed_purge_post, $product_id ) $lscwp_categories = wp_get_post_categories( $product_id , array( fields => all ) ) $lscwp_cats = array() if( $lscwp_categories ) foreach($lscwp_categories as $lscwp_c) if (defined(LSCWP_V)) do_action( litespeed_purge_url, get_category_link( $lscwp_c ->term_id ) ) I couldnt understand function of lscwp_cats variable above. it was a code snippet I grabbed from my handbook for something else, I guess I didnt modify it properly. The idea behind the scene is : Use product ID to retrieve the category IDs Since one product can linked to multiple categories, so you need form an array and loop through them, Then use category ID to obtain the URI, then fire the purge URI I modified the code below. It works add_action(woocommerce_update_product, lscwp_purge_product_update, 10, 2) function lscwp_purge_product_update($product_id, $product) if (defined(LSCWP_V)) do_action( litespeed_purge_post, $product_id ) $lscwp_categories = get_the_terms($product_id, product_cat) if( $lscwp_categories ) foreach($lscwp_categories as $lscwp_c) if (defined(LSCWP_V)) do_action( litespeed_purge_url, get_category_link( $lscwp_c ->term_id ) )



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference