Magento: Page Cache anpassen

23. August 2011 at 11:22

Das Caching könnt ihr in Magento wie folgt beeinflussen:

protected function _construct()
{
$this->addData(array(
'cache_lifetime'    => 900,
'cache_tags'        => array(Mage_Catalog_Model_Product::CACHE_TAG),
'cache_key'            => $this->getCacheKey()
));
}
public function getCacheKey()
{
return $this->getRequest()->getRequestUri().$this->getCacheCurrencyCode();
}
//retreive current currency code
public function getCacheCurrencyCode()
{
return Mage::app()->getStore()->getCurrentCurrencyCode();
}

De-Aktivieren könnt ihr das Caching wie folgt:

protected function _construct()
{
$this->addData(array(
'cache_lifetime'    => null,
'cache_tags'        => array(Mage_Catalog_Model_Product::CACHE_TAG)
));
}
Daniel Briegert

Daniel Briegert

xing: https://www.xing.com/profile/Daniel_Briegert

More Posts - Website

Follow Me:
TwitterFacebook