Commit caa32558 authored by Jordan Michaels's avatar Jordan Michaels

bugfix for exclude process on preload cache

parent 7a9f154c
...@@ -56,7 +56,7 @@ class Vivio_Swift_Cache_Preload ...@@ -56,7 +56,7 @@ class Vivio_Swift_Cache_Preload
$urls = array(); $urls = array();
// make sure the specified amount of time has passed before we do another run // 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 option to select mobile cache as well
// TODO Add options to select what we want to cache. For now, CACHE ALL THE THINGS // 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 ...@@ -154,14 +154,13 @@ class Vivio_Swift_Cache_Preload
foreach ($urls as $url){ foreach ($urls as $url){
// process exclusions if ($exclude_response = Vivio_Swift_Cache_Excludes::process_cache_excludes($url,$force)){
if (!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.
// if the url matches one of our excludes, don't cache it, just move on. $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Preload::create_preload_cache() - Exclude rule hit: ".$exclude_response."[SKIPPING]", 1);
continue; continue;
} }
// send urls off to the caching process // 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); Vivio_Swift_Cache::cache_url_with_agent($url, VIVIO_SWIFT_CACHE_BOT_NAME);
} }
......
...@@ -12,6 +12,7 @@ class Vivio_Swift_Cache ...@@ -12,6 +12,7 @@ class Vivio_Swift_Cache
function cache_url_with_agent($url, $agent) function cache_url_with_agent($url, $agent)
{ {
global $vivio_swift_global; 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( $args = array(
'timeout' => 10, 'timeout' => 10,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment