SwissUpLabs Logo

How to add additional cache keys

Lets assume that some third-party extension has it’s own rendering logic for mobile users.

Usually it will be some method in extension’s helper: Mage::helper('module')->isMobile()

TM_Cache module has a special event to take this, or any other flag into consideretion, while cache entry is creating or loading.

  1. Add the following code in third-party config.xml file (events section):

  2. Here is an example of tmcachePrepareCacheKey method:

    public function tmcachePrepareCacheKey($object)
        $params = $object->getParams();
            'MODULE_is_mobile' => Mage::helper('module')->isMobile()

That’s all. Now Full Page Cache module will depend on third-party module logic too.

Next up

Edit this Page