Very often Magento required Cache "Refresh" to be done. I am looking for a Cron Job Command for Magento Cache "Refresh". I need to Refresh cache and not Clear them.

To "Clear" cache, Cron job command I got is: rm -rf /home/hosting/html/var/cache/*

Whats the command for refresh ?

The main blog I always need to Refresh is "BLOCK_HTML" I would like to set a cron job for it, every 15 minutes

1 Answer 1


n98 MageRun would be perfect for this. Just add a cron entry for

magerun cache:clean block_html

However, you would be out of your mind if you did this on a production store. You should never clear the cache, instead let it expire naturally.

In which case, you could achieve the same by extending the core and overriding the behaviour of Mage_Core_Model_Cache and altering the behaviour of the getCacheLifetime() method to be hard coded to 15 minutes.

I wouldn't do this either though, however I'm sure you have a compelling reason to want to do something so severe.

  • Often when I log in I see a message Cache Refreshis required. Where can I control the expiration time of this message?
    – philtak
    Dec 12, 2014 at 14:57
  • Ignore the message :) Dec 12, 2014 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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