4

i'm using memcache and redis. is it possible to clear only a certain page or group of pages using these? Howso? For example i'd like to be able to only clear the homepage instead of the entire FPC.

Thanks.

3

If you know the tags of the pages you can remove only those using

    $cache = Mage::app()->getCache();
    foreach($cache->getTags() as $tag){
        if(strpos($tag, 'my_cache_tag')){
            $ids = $cache->getIdsMatchingAnyTags(array($tag));
            foreach($ids as $id){
                $cache->remove($id);
            }
        }
    }

This can also be used to find out the keys you want to delete inspecting the content of the $cache->getTags() object. Source here.

Here is a good guide for Magento cache management too.

  • does this work with FPC? – easymoden00b Jun 26 '15 at 18:59
  • It should. Have you tried it? – mbalparda Jun 26 '15 at 19:08
  • how would one define or find a specific cache tag? – easymoden00b Jun 26 '15 at 20:45
  • In the second link you will find out how to create cache with a tag and how to manipulate it once created. To find out a tag you will have to look into the core or maybe dump the content of $cache->getTags() object. – mbalparda Jun 26 '15 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.