Thursday 15 September 2016

Magento programatically clear cache from particular section.


If your magento's cache is enable and for particular section your dynamically content not reflect and remains same for every category or product page  use following code.

<?php Mage::app()->saveUseCache('block_html'); ?>

If you just need to refresh one type, Bock Html OutPut for instance, you just need to use this :
$type= "block_html";
Mage::app()->getCacheInstance()->cleanType($type);

 

That's it. Hope it will help you  :)