Magento with clear/warming up/reload the cache file
Last updated onThis file will help you clear/warming up/reload your Magento cache and you also can use it to fix error “front controller reached 100 router match iterations”, please copy code and save it as a .php file then upload it to root directory and run by: http://yourdomain.com/name-of-file.php :
$path = getenv("MAGE_PATH"); if (!file_exists($path)) { $path = dirname(__FILE__) . '/app/Mage.php'; } require_once($path); $caches = array(); foreach (Mage::app()->useCache() as $type => $status) { if ($type == 'config') { $status = 1; } $caches[$type] = $status; } Mage::app()->saveUseCache($caches); Mage::reset(); if (!Mage::app()->useCache('config')) { die("Config cache needs to be enabled."); } /*** Clear the cache ***/ Mage::app()->getCacheInstance()->clean(); Mage::app()->getCacheInstance()->flush(); Mage::app()->getCache()->clean(); Mage::reset(); /*** Warming up the cache ***/ Mage::app(); Mage::reset(); Mage::app()->getCacheInstance()->remove('config_global'); Mage::app()->init(Mage_Core_Model_App::ADMIN_STORE_ID, 'store'); echo "Done\n";
2 Comments
Hedge Path
It’s exhausting to find knowledgeable folks on this topic, but you sound like you realize what you’re speaking about! Thanks
Felicia Ferrer
Good article.