protected function _saveCache($data)
{
if (!$this->getCacheLifetime() || !$this->_cacheState->isEnabled(self::CACHE_GROUP)) {
return false;
}
$cacheKey = $this->getCacheKey();
$data = str_replace(
$this->_sidResolver->getSessionIdQueryParam($this->_session) . '=' . $this->_session->getSessionId(),
$this->_getSidPlaceholder($cacheKey),
$data
);
$this->_cache->save($data, $cacheKey, array_unique($this->getCacheTags()), $this->getCacheLifetime());
return $this;
}
protected function getCacheLifetime()
{
if (!$this->hasData('cache_lifetime')) {
return null;
}
$cacheLifetime = $this->getData('cache_lifetime');
if (false === $cacheLifetime || null === $cacheLifetime) {
return $cacheLifetime;
}
return (int)$cacheLifetime;
}
!$this->getCacheLifetime() will always set to be true if the block does not have cache_lifetime attribute ?
Can anyone help me ?