一般来说,我们安装Magento插件、定义模板,都需要清除Magento缓存,一般来说可以通过后台界面里的System->Cache Storage Management清除缓存
如果嫌麻烦,也可以用有以下几种方法
方法一:SSH命令行清除缓存
1
2
cd
..
/magentonotes
.com
/mangento/var/cache
rm
-rf *
1
2
|
cd
..
/magentonotes
.com
/mangento/var/cache
rm
-rf *
|
方法二:Magento内部里加入清除缓存的功能代码
1
2
3
|
Mage::app()->cleanCache();
或者
age::app()->getCache()->clean();
|
把以上代码加入到你需要清除缓存的地方即可。
方法三:服务器里加入定时刷新缓存脚本
1
2
3
4
5
|
$magento_bootstrap=
'../app/Mage.php'
;
require_once $magento_bootstrap;
umask
(0);
Mage::run();
Mage::app()->cleanCache();
|
这里的../app/Mage.php就是我们常用的Mage::
Mage.php的原理机制其实和Zend Framwork中BootStrap是一样的
source: https://www.magentonotes.com/clear-magento-cache.html