Issues trying to prime the page cache
-
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!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issues trying to prime the page cache’ is closed to new replies.