Closed OlgaBurtyka closed 8 years ago
Hello @OlgaBurtyka
Lesti_Fpc_Model_Fpc
is just extending from Mage_Core_Model_Cache
, but this class has the function getFrontend. This function will return an object of type Zend_Cache_Core
and there exists the function getIdsMatchingAnyTags or maybe better getTags. Maybe a possible solution for you can be:
$fpcModel = Mage::getSingleton('fpc/fpc');
$arrayAllProductIds = array_map(
function($value) {
return sha1('product_' . $value);
},
$arrayAllProductIds
);
$arrayAllProductIds = array_intersect(
$arrayAllProductIds,
$fpcModel->getFrontend()->getTags()
);
$fpcModel->clean($arrayAllProductIds);
I hope this will help you, but please note this works also:
$fpcModel = Mage::getSingleton('fpc/fpc');
$arrayAllProductIds = array_map(
function($value) {
return sha1('product_' . $value);
},
$arrayAllProductIds
);
$fpcModel->clean($arrayAllProductIds);
Thank you very much for your answer.
Hi! Thank you for your extension. Can you, please, say me one thing. I used magento 1.4. For clean cache by product ID i used this code :
$fpcModel = Mage::getSingleton('fpc/fpc'); if (is_object($fpcModel)) {
} How I can check if product have cache by product id already? Thanks.