Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento“;“刷新缓存存储”;_Magento_Caching_Cron_Storage_Flush - Fatal编程技术网

Magento“;“刷新缓存存储”;

Magento“;“刷新缓存存储”;,magento,caching,cron,storage,flush,Magento,Caching,Cron,Storage,Flush,我理解Magento()中“刷新Magento缓存”和“刷新缓存存储”之间的区别。我正在尝试一个cron作业,它会不时刷新缓存存储 我假设这个按钮不只是删除var/cache/的内容,但是我找不到一个可靠的资源来说明它的功能。我正在使用APC以及所有内置的Magento缓存功能 是否可以从脚本运行与“Fluch Cache Storage”(Fluch Cache Storage)按钮等效的操作?在app/code/core/Mage/Adminhtml/controllers/CacheCon

我理解Magento()中“刷新Magento缓存”和“刷新缓存存储”之间的区别。我正在尝试一个cron作业,它会不时刷新缓存存储

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


是否可以从脚本运行与“Fluch Cache Storage”(Fluch Cache Storage)按钮等效的操作?

app/code/core/Mage/Adminhtml/controllers/CacheController.php
中,可以看到调用了
FlushalAction()
(单击
刷新缓存存储时调用的操作)

此函数包含以下内容:

/**
 * 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文件。

您可以找到关于“刷新缓存存储”和“刷新Magento缓存”之间区别的好解释

我同意您应该使用以下方法创建CRON任务(如果确实需要干净的缓存)():

public function flushAllAction()
{
    // Additional code if necessary
    Mage::app()->getCacheInstance()->flush();
    // Additional code if necessary
}
如果你需要进一步的帮助,请尽管开口