From 1582ee126f55b230a9910d0189ee51cd7f75628a Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 26 Sep 2013 16:24:50 +1200 Subject: [PATCH] MDL-41997 cache: dummy store now uses static acceleration for session + request --- cache/classes/definition.php | 2 +- cache/classes/dummystore.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cache/classes/definition.php b/cache/classes/definition.php index 302bc178070..281fa30d9d1 100644 --- a/cache/classes/definition.php +++ b/cache/classes/definition.php @@ -824,7 +824,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(); + } } /** -- 2.43.0