• Hi all,

    I’m trying to write a PHP function that I can call through a cronjob in order to prime the W3 Total Cache Page Cache.

    This way I don’t have to rely on the WP-Cron.

    I’ve tried calling the URL’s of the website with cURL:

    $ch = curl_init();
    
    curl_setopt( $ch, CURLOPT_URL, $url );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 60 );
    curl_setopt( $ch, CURLOPT_HEADER, true );
    curl_setopt( $ch, CURLOPT_NOBODY, true );
    curl_setopt( $ch, CURLOPT_USERAGENT, "W3 Total Cache ( Auto-Cache Engine )" );
    
    $result = curl_exec( $ch );
    
    curl_close( $ch );

    and with file_get_contents( $url );

    Nothing seems to actually cache the pages. Does anybody have an idea on what I might be doing wrong here? Thanks!

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Please use the “Suggest a new feature” option in the Support tab of the plugin.

    Thread Starter Octopixell

    (@octopixell)

    Willie,

    I’m pretty sure there’s been enough people now talking about how the priming of W3TC is far from OK for you guys to have implemented something better.

    Also I think I wasn’t doing anything wrong, I just had to adjust garbage collection settings and the prime settings in W3TC.

    I will however do a feature suggestion as you have asked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issues trying to prime the page cache’ is closed to new replies.