Preload on after clearing all cache
-
Hi.
Hey,
The plugin works great — no complaints at all. I just have a scaling question.
I’m running a WooCommerce store with ~5,000 products and ~10,000 total pages. Products are updated almost daily (price, stock, content), and the client requires changes to be visible immediately — even in incognito.
Right now, the only way to guarantee that is to clear the entire cache. But when I do that:
- All cache is wiped
- Preload has to rebuild ~10k pages
- Site is slower until preload finishes
- Then another update happens… and repeat
Some updates are product data (price/stock), others are layout changes in the builder. If cache isn’t cleared fully, visual bugs appear due to CSS/minified assets.
Currently I use custom code that detects changes and clears everything (including minified CSS), because tracking specific affected URLs is difficult — many pages are dynamic.
My question:
Is there a way to:
- Keep existing preload/cache intact
- Only invalidate affected pages when content changes
- Clear/regenerate CSS assets when needed
- Avoid fully wiping the entire cache every time
Basically:
Can preload remain available while only specific pages regenerate on next visit, instead of destroying the entire warmed cache?Would appreciate any architecture suggestions or best practices for large WooCommerce stores with frequent updates.
Thanks.
My basic code is this:/**
- Clear WP Fastest Cache + Minified CSS/JS
- When a post is created, updated, or deleted
*/
function auto_clear_wpfc_cache_with_minified( $post_id ) { // Prevent autosave / revisions
if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) {
return;
} if ( wp_is_post_revision( $post_id ) ) {
return;
} // Make sure WP Fastest Cache function exists
if ( function_exists( ‘wpfc_clear_all_cache’ ) ) {
wpfc_clear_all_cache( true ); // TRUE = also clear minified CSS/JS
}
}
// Trigger on save/update
add_action( ‘save_post’, ‘auto_clear_wpfc_cache_with_minified’ );// Trigger on delete
add_action( ‘deleted_post’, ‘auto_clear_wpfc_cache_with_minified’ );
Regards,
You must be logged in to reply to this topic.
