Created
January 23, 2013 14:17
-
-
Save ralph-tice/4606111 to your computer and use it in GitHub Desktop.
Modifying /app/code/core/Mage/Core/Model/Layout/Update.php for reduction in total size of cache generated. ~250-300mb reduced to ~25-30mb. Tested on Magento 1.4.2.
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
/** | |
* Get cache id | |
* | |
* @return string | |
*/ | |
public function getCacheId() | |
{ | |
if (!$this->_cacheId) { | |
// -- CORE CHANGE | |
// -- remove store scoping to optimize cache usage | |
// $this->_cacheId = 'LAYOUT_'.Mage::app()->getStore()->getId().md5(join('__', $this->getHandles())); | |
$handles = $this->getHandles(); | |
//remove store scope handle to reduce uniqueness of cached layouts --rtice | |
$handles = array_diff($handles, array('STORE_'.Mage::app()->getStore()->getCode())); | |
$this->_cacheId = 'LAYOUT_'.md5(join('__', $handles)); | |
// -- END CORE CHANGE | |
} | |
return $this->_cacheId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment