目前我正在使用 lesti fpc 进行缓存。现在我想刷新一些特定的产品缓存,它们的库存更新直接在数据库中。
我发现这个。但不知道如何使用这个。
$this->_getFpc()->clean(sha1('product_' . $item->getProductId()));
您可以像这样在 CRON 或 SCRIPT 中使用 LESTI:
$productId = 'yourproductidhere';
$lesti = Mage::getSingleton('fpc/fpc');
$clean = $lesti->clean(sha1('product_' . $productId));
对于 CMS 块
$blockIdentifier = 'blockidentifierhere'
$lesti->clean(sha1('cmsblock_' . $blockIdentifier));
对于 CMS 页面
$pageIdentifier = 'pageidentifierhere';
$lesti->clean(sha1('cms_' . $pageIdentifier));
类别
$categoryid = 'yourcategoryidhere';
$lesti->clean(sha1('category_' . $categoryid));