How to refresh full page cache of a particular product in magento

1.6k views Asked by At

Currently i am using lesti fpc for cache. now i want to refresh some particular products cache whose stock update direct in database.

i find this. but don't know how to use this.

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

There are 1 answers

0
Kurdt94 On

You can use LESTI in your CRON or SCRIPT like so :

$productId = 'yourproductidhere';

$lesti = Mage::getSingleton('fpc/fpc');
$clean = $lesti->clean(sha1('product_' . $productId));

for CMS blocks

$blockIdentifier = 'blockidentifierhere'
$lesti->clean(sha1('cmsblock_' . $blockIdentifier));

for CMS pages

$pageIdentifier = 'pageidentifierhere';
$lesti->clean(sha1('cms_' . $pageIdentifier));

for CATEGORY

$categoryid = 'yourcategoryidhere';
$lesti->clean(sha1('category_' . $categoryid));