Skip to content

Commit

Permalink
MDL-41997 cache: dummy store now uses static acceleration for session…
Browse files Browse the repository at this point in the history
… + request
  • Loading branch information
Sam Hemelryk committed Sep 29, 2013
1 parent 0055b93 commit 96f91e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache/classes/definition.php
Expand Up @@ -823,7 +823,7 @@ public function use_static_acceleration() {
// 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;
}

/**
Expand Down
7 changes: 6 additions & 1 deletion cache/classes/dummystore.php
Expand Up @@ -113,7 +113,12 @@ public function initialise(cache_definition $definition) {
// 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();
}
}

/**
Expand Down

0 comments on commit 96f91e3

Please sign in to comment.