Skip to content

Commit

Permalink
prevent server overload due to a tsunami of AO cache preloading (prob…
Browse files Browse the repository at this point in the history
  • Loading branch information
futtta committed Jan 2, 2018
1 parent 57846fa commit e985093
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/autoptimizeCache.php
Expand Up @@ -105,7 +105,8 @@ function autoptimize_do_cachepurged_action() {
add_action("autoptimize_action_cachepurged","autoptimize_flush_pagecache",10,0);

// warm cache (part of speedupper)?
if ( apply_filters('autoptimize_filter_speedupper', true) ) {
if ( apply_filters('autoptimize_filter_speedupper', true) && get_transient('autoptimize_warmcache_buster') == false ) {
set_transient('autoptimize_warmcache_buster', 'please bust me next time', HOUR_IN_SECONDS);
$warmCacheUrl = site_url()."/?ao_speedup_cachebuster=".rand(1,100000);
$warmCache = @wp_remote_get($warmCacheUrl);
unset($warmCache);
Expand Down

0 comments on commit e985093

Please sign in to comment.