I am using Magento ver1.6.1. I need to clear Magento cache programmatically.
Mage::app()->getCache()->clean()
I used the above code b
If you are using Magento Enterprise (I'm using 1.13), the above code in the aforementioned answers does not seem to be enough to flush the full page cache.
It took me a while to figure out what was going on, but there are a few methods that fire as a result of events when using the web interface that would not be covered when using the code above. Of critical importance, is the cleanCache
method of Enterprise_PageCache_Model_Observer
.
To fix, I added the following code after either Magento Guy or Oğuz Çelikdemir's code.
Enterprise_PageCache_Model_Cache::getCacheInstance()
->clean(Enterprise_PageCache_Model_Processor::CACHE_TAG);
Hope this saves someone some time!