Magento - Specific product clean cache using lesti fpc when i change stock in the database using script
-
I have a store with over 80K products. I have used Lesti_fpc to enhance its performance. I add and remove products from the store using magmi. The products are provided by various vendors in the form of xml. Thus we directly change product stock in the database using magmi. I want to clear the cache of those products whose stock is zero in the xml file. I am calling the following function in the magmi script. I have included the save.php file of fpc in our script. then created an object of the class Lesti_Fpc_Model_Observer_Save in our script, and called a custom function (which I have created in this class) the function is as below. public function clearProductCache($productId = null) { //$this->_getFpc()->clean(sha1('product_' . $productId)); $this->_getFpc()->clean($productId); die('test'); } this function executes but the cache does not clear. Any help is appreciated.
-
Answer:
This should works in your case. Change 1000012 by your Product Id. $cacheId = sha1("product_1000012"); $fpc = Mage::getModel('fpc/fpc'); $fpc->clean($cacheId);
user3505489 at Stack Overflow Visit the source
Related Q & A:
- How do I change a password directly in the PhpBB3 SQL database?Best solution by Server Fault
- How do I change my status using Facebook Mobile?Best solution by wikihow.com
- How do I change the resolution when it is too big for my screen! When I change it my screen stays black?Best solution by Yahoo! Answers
- How can I make my room look amazing when I clean it?Best solution by Yahoo! Answers
- There are times when I must use bleach or ammonia to clean?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.