diff --git a/cache/classes/definition.php b/cache/classes/definition.php index 9d5c0a25b8f..f414cd677d2 100644 --- a/cache/classes/definition.php +++ b/cache/classes/definition.php @@ -823,7 +823,7 @@ class cache_definition { // Request caches should never use static acceleration - it just doesn't make sense. return false; } - return $this->staticacceleration || $this->mode === cache_store::MODE_SESSION; + return $this->staticacceleration; } /** diff --git a/cache/classes/dummystore.php b/cache/classes/dummystore.php index 13c3017bd24..55ee3add584 100644 --- a/cache/classes/dummystore.php +++ b/cache/classes/dummystore.php @@ -113,7 +113,12 @@ class cachestore_dummy extends cache_store { // store things in its static array. // - If the definition is not using static acceleration then the cache loader won't try to store anything // and we will need to store it here in order to make sure it is accessible. - $this->persist = !$definition->use_static_acceleration(); + if ($definition->get_mode() !== self::MODE_APPLICATION) { + // Neither the request cache nor the session cache provide static acceleration. + $this->persist = true; + } else { + $this->persist = !$definition->use_static_acceleration(); + } } /**