【问题标题】:How to refresh full page cache of a particular product in magento如何在magento中刷新特定产品的整页缓存
【发布时间】:2016-07-13 16:41:29
【问题描述】:

目前我正在使用 lesti fpc 进行缓存。现在我想刷新一些特定的产品缓存,它们的库存更新直接在数据库中。

我发现了这个。但是不知道怎么用。

$this->_getFpc()->clean(sha1('product_' . $item->getProductId()));

【问题讨论】:

    标签: magento lesti-fpc


    【解决方案1】:

    你可以像这样在你的 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));
    

    【讨论】:

      猜你喜欢
      • 2012-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-12
      • 2012-06-14
      相关资源
      最近更新 更多