我明白了「同花順的Magento緩存」和「清除緩存存儲」之間在Magento(example)的差異。我正在嘗試使用cron作業來刷新緩存存儲。Magento的「清除緩存存儲」
我假設,這個按鈕不只是刪除VAR /緩存/的內容,但我找不到,說什麼它做了堅實的資源。我正在使用APC以及所有內置的Magento緩存功能。
是否可以運行「Fluch緩存存儲」按鈕,從腳本相同呢?
我明白了「同花順的Magento緩存」和「清除緩存存儲」之間在Magento(example)的差異。我正在嘗試使用cron作業來刷新緩存存儲。Magento的「清除緩存存儲」
我假設,這個按鈕不只是刪除VAR /緩存/的內容,但我找不到,說什麼它做了堅實的資源。我正在使用APC以及所有內置的Magento緩存功能。
是否可以運行「Fluch緩存存儲」按鈕,從腳本相同呢?
在app/code/core/Mage/Adminhtml/controllers/CacheController.php
中,您可以看到flushAllAction()
(單擊Flush Cache Storage
時調用的操作)被調用。
此功能包含以下內容:
/**
* Flush cache storage
*/
public function flushAllAction()
{
Mage::dispatchEvent('adminhtml_cache_flush_all');
Mage::app()->getCacheInstance()->flush();
$this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The cache storage has been flushed."));
$this->_redirect('*/*');
}
要在自己的文件中調用這個,你可以做到以下幾點。
require_once('app/Mage.php');
Mage::app()->getCacheInstance()->flush();
現在,您可以使用cronjob運行您的php文件。