Hello @robertfudge
Thank you for your question and I am happy to help!
Yes, it is possible to do this. The server cron job depends on your control panel.
The best thing would be to reach out to your hosting provider to setup a custom Cron to run every 4 hours and call $w3_plugin_totalcache->flush_all();
I hope this helps!
Thanks!
Thanks, Do I add this function to a PHP file and point the corn job to the file?
Hello @robertfudge
Thank you for your question.
Yes, you can run the screept from corn every X hours
For example:
/ Scheduled Action Hook
function w3_flush_cache( ) {
$w3_plugin_totalcache->flush_all();
}
// Schedule Cron Job Event
function w3tc_cache_flush() {
if ( ! wp_next_scheduled( 'w3_flush_cache' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'daily', 'w3_flush_cache' );
}
}
add_action( 'wp', 'w3tc_cache_flush' );
Thanks!