@TONEGOLF71 @SPACE48ERS #MAGETITANS – Wikipedia “Caching is a component that transparently stores data so that future requests for that data can be served faster. ” What is caching?
@TONEGOLF71 @SPACE48ERS #MAGETITANS Magento Cache • Key-value data store • Data can be tagged with meta data • By default is stored on the filesystem (/var) • Other storage backends can be used • We use Redis (thanks Colin Mollenhour)
@TONEGOLF71 @SPACE48ERS #MAGETITANS Problem • Inherited a Magento store • It had a full page caching (FPC) module in place • It was thought that the FPC was clearing too often
@TONEGOLF71 @SPACE48ERS #MAGETITANS Replicate the issue • Small perceptible difference in cached versus uncached page loads. • We were told that the cache dropping seemed to coincide with catalog updates • We tested and yes, product saves would wipe the cache?!
@TONEGOLF71 @SPACE48ERS #MAGETITANS Diagnose the issue • Eliminate as much as possible as quickly as possible • Go back to a core theme • Disable all non-core modules. • The culprit - A bespoke top-nav replacement module!!!
@TONEGOLF71 @SPACE48ERS #MAGETITANS But why? • model_load_after observer in the FPC module • This collects tags for each model loaded via $object->getCacheIdTags() But WHY??
@TONEGOLF71 @SPACE48ERS #MAGETITANS But why? • The bespoke menu navigation module uses Mage::getModel(‘catalog/category’)->load($Id) for each category • Therefore a tag for each category in the menu was added!!!
@TONEGOLF71 @SPACE48ERS #MAGETITANS The solution? • Refactor the navigation menu to work in the same way as the core. • i.e use getCategories() from the category resource model