Magento"Flush Cache Storage"

Mar*_*kie 7 cron storage caching flush magento

我理解Magento中"Flush Magento Cache"和"Flush Cache Storage"之间的区别(示例).我正在尝试处理将不时刷新缓存存储的cron作业.

我假设这个按钮不只是删除var/cache /的内容,但我找不到一个可以说它的功能的可靠资源.我正在使用APC以及所有内置的Magento缓存功能.

是否可以从脚本中运行等效的"Fluch Cache Storage"按钮?

Axe*_*xel 10

在中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('*/*');
}
Run Code Online (Sandbox Code Playgroud)

要在您自己的文件中调用它,您可以执行以下操作.

require_once('app/Mage.php');
Mage::app()->getCacheInstance()->flush();
Run Code Online (Sandbox Code Playgroud)

现在,您可以使用cronjob运行您的php文件.