Support » Plugin: W3 Total Cache » CLear cache daily/hourly via cron

  • AndreiD

    (@andreiro37)



    hi, i want to use WP Control plugin to add some php code to clear the cache daily, automatically.

    I included this custom php code but doesnt work. Should i add something before, a global varioable or to include wp_load.php ?

    $w3_plugin_totalcache->flush_all();

Viewing 1 replies (of 1 total)
  • hsteigstra

    (@hsteigstra)

    Hi Andrei,
    I do that with a self made procedure:
    $uri= $_SERVER[HTTP_HOST] . $page;
    $dirname=ABSPATH . “wp-content/cache/page_enhanced/” . $uri;
    array_map(‘unlink’, glob(“$dirname/*.*”));
    rmdir($dirname);
    $protocol = isset($_SERVER[“HTTPS”]) ? ‘https’ : ‘http’;
    $uri=$protocol . ‘://’ . $uri;
    file_get_contents($uri);

    where $page the page to be rebuilt is. If you have many pages, best thing is to create a background job that refreshes each page one by one….

Viewing 1 replies (of 1 total)
  • The topic ‘CLear cache daily/hourly via cron’ is closed to new replies.