W3 Total Cache – Clear page cache every hour automatic

Is it possible to clear the page cache every hour in W3 total cache? I have a dynamic website (plugin) with data that updates maybe every couple minutes so I want to clear the cache every hour so the data is something like up-to-date.

Now I dont use the page cache otherwise the data is not up-to-date but it really slows down my sites response time and I really need to improve it!

Read More

Is this possible with W3 total settings or something?

Regards

Joep

Related posts

1 comment

  1. Put this in your child theme functions.php

    // 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' ), 'hourly', 'w3_flush_cache' );    
        }
    }
    
    add_action( 'wp', 'w3tc_cache_flush' );
    

Comments are closed.