wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 17 forks source link

How to clear paginated homepage programmatically? #935

Open Luc45 opened 4 years ago

Luc45 commented 4 years ago

First, thanks for Comet Cache. It's the best Cache plugin and I've been using it for years.

I have the Pro version, I want to clear the Homepage cache programmatically, but the homepage is paginated. How can I achieve that?

Examples:

Page 1: example.com Page 2: example.com/page/2 Page 287: example.com/page/287

\comet_cache::clear(); // Clears the entire cache, not what I want
\comet_cache::clearUrl( get_site_url() ); // I think this would clear only page 1
\comet_cache::clearPost( get_option( 'page_on_front' ) ); // This could work, but I use "Recent posts" instead of a page on wp-admin/options-reading.php