Skip to content

Instantly share code, notes, and snippets.

@florinel-chis
Created March 3, 2013 20:55
Show Gist options
  • Save florinel-chis/5078251 to your computer and use it in GitHub Desktop.
Save florinel-chis/5078251 to your computer and use it in GitHub Desktop.
Mage_Catalog_Block_Navigation - improved cache key
//Mage_Catalog_Block_Navigation::
public function getCacheKeyInfo(){
$shortCacheId = array(
'CATALOG_NAVIGATION',
Mage::app()->getStore()->getId(),
Mage::getDesign()->getPackageName(),
Mage::getDesign()->getTheme('template'),
// Mage::getSingleton('customer/session')->getCustomerGroupId(),
'template' => $this->getTemplate(),
'name' => $this->getNameInLayout(),
// $this->getCurrenCategoryKey()
);
$cacheId = $shortCacheId;
$shortCacheId = array_values($shortCacheId);
$shortCacheId = implode('|', $shortCacheId);
$shortCacheId = md5($shortCacheId);
// $cacheId['category_path'] = $this->getCurrenCategoryKey();
$cacheId['short_cache_id'] = $shortCacheId;
return $cacheId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment