Created
June 13, 2014 14:09
-
-
Save jrodriguez-ifuelinteractive/a4ccfcff50a1578d88b6 to your computer and use it in GitHub Desktop.
Category Block Cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Ifuel_Cache_Block_Catalog_Category_View extends Mage_Catalog_Block_Category_View | |
{ | |
protected function _construct() | |
{ | |
$this->addData(array( | |
// Long term block | |
'cache_lifetime' => 999999999, | |
'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG, Mage_Catalog_Model_Category::CACHE_TAG), | |
)); | |
} | |
public function getCacheKey() | |
{ | |
return | |
'CATEGORY_CACHE' . | |
md5(Mage::app()->getStore()->getWebsiteId() . | |
'_' . | |
Mage::helper('customer')->isLoggedIn() . | |
'_' . | |
Mage::helper('core/url')->getCurrentUrl()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment