42 'remote_backend' =>
'',
43 'remote_backend_invalidation_time_id' =>
'default_remote_backend_invalidation_time',
44 'remote_backend_custom_naming' =>
true,
45 'remote_backend_autoload' =>
true,
46 'remote_backend_options' => [],
47 'local_backend' =>
'',
48 'local_backend_options' => [],
49 'local_backend_custom_naming' =>
true,
50 'local_backend_autoload' => true
60 $universalOptions = array_diff_key(
$options, $this->_options);
62 if ($this->_options[
'remote_backend'] ===
null) {
65 $this->remote = $this->_options[
'remote_backend'];
68 $this->_options[
'remote_backend'],
69 array_merge($universalOptions, $this->_options[
'remote_backend_options']),
70 $this->_options[
'remote_backend_custom_naming'],
71 $this->_options[
'remote_backend_autoload']
75 'remote_backend must implement the Zend_Cache_Backend_ExtendedInterface interface' 80 if ($this->_options[
'local_backend'] ===
null) {
83 $this->local = $this->_options[
'local_backend'];
86 $this->_options[
'local_backend'],
87 array_merge($universalOptions, $this->_options[
'local_backend_options']),
88 $this->_options[
'local_backend_custom_naming'],
89 $this->_options[
'local_backend_autoload']
93 'local_backend must implement the Zend_Cache_Backend_ExtendedInterface interface' 104 private function updateRemoteCacheStatusInfo()
106 $this->remote->save(
time(), $this->_options[
'remote_backend_invalidation_time_id'], [],
null);
107 $this->cacheInvalidationTime =
null;
115 return $this->local->setDirectives($directives);
121 public function load(
$id, $doNotTestCacheValidity =
false)
123 $dataModificationTime = $this->local->test(
$id);
124 if ($this->cacheInvalidationTime ===
null) {
125 $this->cacheInvalidationTime = $this->remote->load($this->_options[
'remote_backend_invalidation_time_id']);
127 if ($dataModificationTime >= $this->cacheInvalidationTime) {
128 return $this->local->load(
$id, $doNotTestCacheValidity);
139 return $this->local->test(
$id);
145 public function save(
$data,
$id, $tags = [], $specificLifetime =
false)
147 return $this->local->save(
$data,
$id, $tags, $specificLifetime);
153 public function remove(
$id)
155 $this->updateRemoteCacheStatusInfo();
156 return $this->local->remove(
$id);
164 $this->updateRemoteCacheStatusInfo();
165 return $this->local->clean(
$mode, $tags);
173 return $this->local->getIds();
181 return $this->local->getTags();
189 return $this->local->getIdsMatchingTags($tags);
197 return $this->local->getIdsNotMatchingTags($tags);
205 return $this->local->getIdsMatchingAnyTags($tags);
213 return $this->local->getFillingPercentage();
221 return $this->local->getMetadatas(
$id);
229 return $this->local->touch(
$id, $extraLifetime);
237 return $this->local->getCapabilities();
save($data, $id, $tags=[], $specificLifetime=false)
elseif(isset( $params[ 'redirect_parent']))
getIdsMatchingAnyTags($tags=[])
clean($mode=\Zend_Cache::CLEANING_MODE_ALL, $tags=[])
load($id, $doNotTestCacheValidity=false)
__construct(array $options=[])
touch($id, $extraLifetime)
setDirectives($directives)
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
static throwException($msg, Exception $e=null)
getIdsNotMatchingTags($tags=[])
getIdsMatchingTags($tags=[])
static _makeBackend($backend, $backendOptions, $customBackendNaming=false, $autoload=false)