Support » Plugin: Warm Cache » Needs flush to write buffers to prevent timeouts

  • Resolved tflight

    (@tflight)


    Many hosts implement timeouts on PHP scripts that don’t finish (or have any output) for a certain amount of seconds. See here for a longer writeup of the issue:

    Cloud Sites Timeout on CMS Install

    Because of this, the Warm Cache plugin often doesn’t finish its job when it is executed. In my situation I only want it to preload the cache once every three hours. My host limits PHP scripts to 30 seconds (if no output) and with many Pages/Posts it can take four of five runs to get everything preloaded.

    In warm_cache_crawl, around line 68, I added a flush call to the end of the for loop and now the plugin runs fine the first time and no longer times out after 30 seconds.

    for($i = 0;$i < $cnt;$i++){
    				$page = (string)$xml->url[$i]->loc;
    				echo '<br/>Busy with: '.$page;
    				$newvalue['pages'][] = $page;
    				$tmp = wp_remote_get($page);
    				flush(); // prevent timeout from the loadbalancer
    			}

    http://wordpress.org/plugins/warm-cache/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Needs flush to write buffers to prevent timeouts’ is closed to new replies.