Skip to content

Instantly share code, notes, and snippets.

@ralph-tice
Created January 23, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralph-tice/4606111 to your computer and use it in GitHub Desktop.
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.
/**
* 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