diff --git a/vivio-swift/classes/vivio-swift-cache-preload.php b/vivio-swift/classes/vivio-swift-cache-preload.php index 6a0e695e5139ebaa1abce4999f264750a70c5ff0..484a447c7ff7b2f382b0673861a736e03489c6f8 100644 --- a/vivio-swift/classes/vivio-swift-cache-preload.php +++ b/vivio-swift/classes/vivio-swift-cache-preload.php @@ -56,7 +56,7 @@ class Vivio_Swift_Cache_Preload $urls = array(); // make sure the specified amount of time has passed before we do another run - if ( ($this->verify_preload_cache_expired()) || $force ) { + if ( $force || ($this->verify_preload_cache_expired()) ) { // TODO Add option to select mobile cache as well // TODO Add options to select what we want to cache. For now, CACHE ALL THE THINGS @@ -154,14 +154,13 @@ class Vivio_Swift_Cache_Preload foreach ($urls as $url){ - // process exclusions - if (!Vivio_Swift_Cache_Excludes::process_cache_excludes($url,$force)){ - // if the url matches one of our excludes, don't cache it, just move on. + if ($exclude_response = Vivio_Swift_Cache_Excludes::process_cache_excludes($url,$force)){ + // if theres a response, it means the URL should be excluded so just log and move on. + $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Preload::create_preload_cache() - Exclude rule hit: ".$exclude_response."[SKIPPING]", 1); continue; } // send urls off to the caching process - $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Preload::create_preload_cache() - passing to cache_url_with_agent(".$url.", ".VIVIO_SWIFT_CACHE_BOT_NAME.")...", 1); Vivio_Swift_Cache::cache_url_with_agent($url, VIVIO_SWIFT_CACHE_BOT_NAME); } diff --git a/vivio-swift/classes/vivio-swift-cache.php b/vivio-swift/classes/vivio-swift-cache.php index 91472a7976296c88eea95273a8165e2306f4cf81..d94f7b572ea538a3a5e2dad0615067f78cb9b9f5 100644 --- a/vivio-swift/classes/vivio-swift-cache.php +++ b/vivio-swift/classes/vivio-swift-cache.php @@ -12,6 +12,7 @@ class Vivio_Swift_Cache function cache_url_with_agent($url, $agent) { global $vivio_swift_global; + $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache::cache_url_with_agent() - init for URL: ".$url, 0); $args = array( 'timeout' => 10,