Purge cache every update
-
Hi, I would like to create a script in
function.php
to empty the cache each time posts and pages are updated or published.Has anyone done something like this?
The
purge_all()
function; do you think it would work?Ex:
function flush_cache_on_update( $post_id ) {
if ( function_exists( 'purge_all' ) ) {
purge_all();
}
}
add_action( 'publish_post', 'flush_cache_on_update' )
add_action( 'publish_page', 'flush_cache_on_update' );Thanks in advance for the support
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Purge cache every update’ is closed to new replies.