Clear cache from custom function

Hello @tasoft,

You can use the following public function, to purge the entire cache:

if (function_exists('sg_cachepress_purge_cache')) {
    sg_cachepress_purge_cache();
}

Alternatively, you can pass an URL to the function to clear the cache for this specific page, instead of flushing the entire cache:

if (function_exists('sg_cachepress_purge_cache')) {
    sg_cachepress_purge_cache('https://yoursite.com/pluginpage');
}

For more details please refer to our official documentation:
https://projectdmc.org/plugins/sg-cachepress/

The cache purging and exclude functions can be found in the “Plugin Compatibility” section.

Best Regards,
Tsvetan Mitev

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Your Advertisement Here