I have a problem: When I'm trying to flush Magento cache programmatically like this:
$types=array('config','layout','block_html','translate','collections','eav','config_api','config_api2');
foreach($types as $type) {
$c = Mage::app()->getCacheInstance()->cleanType($type);
Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => $type));
}
[source]
I have already read this article about Magento cache and it's flushing, but I'm still missing something.
The above method should do the same as does the "Flush Magento Cache" button, but it doesn't in my case. When I'm running a script I'm saving a new controller, but it doesn't work after cache flushing programmatically with the way described above (and many others I have already tried).
But as soon as I perform the same from admin panel manually in the middle of the script's job- it starts working correctly.
Any idea? Does it help, if I will put here scripts code?
Thanks in advance!