What is the code for clean or refresh the cache programmatically because I have got lots of snippets but all are not working in Magento 1 enterprise edition.
Does anyone know how to solve it? Thanks in advance.
To clean cache use this:
To flush cache use this:
You can also use this if you are trying to flush specific cache:
$tags = Mage::app()->getCacheInstance()->cleanType($type); Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => $type));
Possible types are as follows:
Note: You might face problem if you are doing it on frontend. Make sure you do it on admin area.