2017 © Pedro Peláez
 

magento-module aoe_modelcache

Magento Model Cache

image

aoepeople/aoe_modelcache

Magento Model Cache

  • Thursday, March 26, 2015
  • by fbrnc
  • Repository
  • 57 Watchers
  • 16 Stars
  • 576 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Aoe_ModelCache

Instructions

Load models from cache

Replace..., (*1)

$product = Mage::getModel('catalog/product')->load($id);

... with, (*2)

$product = Mage::helper('aoe_modelcache')->get('catalog/product', $id);

If the model was create before the previous instance will be reused. If it wasn't created before it will be created now., (*3)

Forcing clean model

$product = Mage::helper('aoe_modelcache')->get('catalog/product', $id, true);

The difference to Mage::getModel('catalog/product')->load($id) is, that the created model will be cached and can be reused for future calls without the clean parameter, (*4)

Check if model exists in cache

$modelExists = Mage::helper('aoe_modelcache')->exists('catalog/product', $id);

Remove model from cache

Mage::helper('aoe_modelcache')->removeFromCache('catalog/product', $id);

Finding candidates for optimization

Enable the log from System > Configuration > ADVANCED > Developer > AOE Model Cache Log Settings and check var/log/aoemodelcache.log after hitting a page. You'll find all occurrences of models that have been loaded more than once incl. file and line where the call happened. These items are candidates for replacement by model cache calls., (*5)

Caution!

Please test the shop properly after having any changes in place. Side-effects where fresh objects are expected and a "used" instances is returned are possible., (*6)

The Versions

26/03 2015

dev-master

9999999-dev

Magento Model Cache

  Sources   Download

OSL-3.0

The Requires

 

26/03 2015

dev-experimental

dev-experimental

Magento Model Cache

  Sources   Download

OSL-3.0

The Requires

 

13/03 2014

0.0.2

0.0.2.0

Magento Model Cache

  Sources   Download

OSL-3.0

The Requires