I am using Magento ver1.6.1. I need to clear Magento cache programmatically.
Mage::app()->getCache()->clean()
I used the above code b
This is what you're after:
try {
$allTypes = Mage::app()->useCache();
foreach($allTypes as $type => $blah) {
Mage::app()->getCacheInstance()->cleanType($type);
}
} catch (Exception $e) {
// do something
error_log($e->getMessage());
}
Here's how you would do it automatically:
http://mikebywaters.wordpress.com/2011/12/09/automatically-refresh-magento-cache/