diff --git a/system/src/Grav/Common/Cache.php b/system/src/Grav/Common/Cache.php index 09278295e..f7a6d4bae 100644 --- a/system/src/Grav/Common/Cache.php +++ b/system/src/Grav/Common/Cache.php @@ -40,6 +40,8 @@ class Cache extends Getters protected $driver_name; + protected $driver_setting; + /** * @var bool */ @@ -108,13 +110,15 @@ class Cache extends Getters // Cache key allows us to invalidate all cache on configuration changes. $this->key = ($prefix ? $prefix : 'g') . '-' . substr(md5($uri->rootUrl(true) . $this->config->key() . GRAV_VERSION), 2, 8); + $this->driver_setting = $this->config->get('system.cache.driver'); + $this->driver = $this->getCacheDriver(); // Set the cache namespace to our unique key $this->driver->setNamespace($this->key); // Dump Cache state - $grav['debugger']->addMessage('Cache: [' . ($this->enabled ? 'true' : 'false') . '] Driver: [' . $this->driver_name . ']'); + $grav['debugger']->addMessage('Cache: [' . ($this->enabled ? 'true' : 'false') . '] Setting: [' . $this->driver_setting . '] Driver: [' . $this->driver_name . ']'); } @@ -127,7 +131,7 @@ class Cache extends Getters */ public function getCacheDriver() { - $setting = $this->config->get('system.cache.driver'); + $setting = $this->driver_setting; $driver_name = 'file'; if (!$setting || $setting == 'auto') {