Permalink
Browse files

move transient-check inside updateCode to avoid both warmCache reques…

…ts and the cache being purged too often
  • Loading branch information...
futtta committed Jan 4, 2018
1 parent a1e7b88 commit 317f3305c268a86593075edace64130f1f43aa89
Showing with 3 additions and 3 deletions.
  1. +1 −2 classes/autoptimizeCache.php
  2. +2 −1 classlesses/autoptimizeUpdateCode.php
@@ -105,8 +105,7 @@ 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) && get_transient('autoptimize_warmcache_buster') == false ) {
set_transient('autoptimize_warmcache_buster', 'Mamsie & Liessie zehhe: ZWIJH!', HOUR_IN_SECONDS);
if ( apply_filters('autoptimize_filter_speedupper', true) ) {
$warmCacheUrl = site_url()."/?ao_speedup_cachebuster=".rand(1,100000);
$warmCache = @wp_remote_get($warmCacheUrl);
unset($warmCache);
@@ -98,8 +98,9 @@
$majorUp = true;
}
if ( $majorUp === true ) {
if ( $majorUp === true && get_transient('autoptimize_stale_option_buster') == false ) {
// clear cache and notify user to check result if major upgrade
set_transient('autoptimize_stale_option_buster', 'Mamsie & Liessie zehhe: ZWIJH!', HOUR_IN_SECONDS);
autoptimizeCache::clearall();
add_action('admin_notices', 'autoptimize_update_config_notice');
}

0 comments on commit 317f330

Please sign in to comment.