Purge all caches for single product page programmatically?
-
Hello,
Can someone please help me, I’m trying to flush page cache for a single product with this code:if(!get_the_content()){ $generate_content = 'Some Content'; $update_product_content = array( 'ID'=>$product_page_id, 'post_content'=>$generate_content ); wp_update_post($update_product_content); if(defined('LSCWP_V')){ do_action('litespeed_purge_url', get_the_permalink()); } //FLUSH CACHE LiteSpeed }
But nothing’s happening on the front-end after refreshing the page in the browser – I still see cached version of the page, while in the back-end I see message, that cache for the url was succesfully purged.
I have tried also to use this code:
if(defined('LSCWP_V')){do_action('litespeed_purge_post', $product_page_id);}
But with this hook, I don’t even see a message in the back-end, that cache for the page was purged.
I’m using latest version of LiteSpeed Plugin, WordPress and Woocommerce with Memcache Object Caching & OPcache.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Purge all caches for single product page programmatically?’ is closed to new replies.