[英]Detect home page in Magento .phtml that will work with BLOCK_HTML cache enabled
[英]Magento how I refresh block_html cache after product save using programmatically
我正在尝试在产品保存/保存并在管理端继续后以编程方式刷新Magento缓存。 我已经试过了
Mage::app()->getCacheInstance()->cleanType('block_html');
目录产品保存事件后观察者。我也试试
foreach($types as $type) {
$c = Mage::app()->getCacheInstance()->cleanType($type);
Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => $type));
}
但这不起作用。
请使用以下代码。 它正在发挥作用。 请参阅http://www.magebuzz.com/blog/magento-clear-cache-programmatically/
try {
$type = 'block_html';
Mage::app()->getCacheInstance()->cleanType($type);
} catch (Exception $e) {
Mage::log($e->getMessage());
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.