magentomagmi

Magento Magmi import and caching issue


Who can help - I am importing simple products into Magento 1.9.x using Magmi. Is it correct that cache is not deleted after import? And is there a way to flush only caches (product caches, full page cache) related to the imported products?


Solution

  • You dont need to delete the cache, just flush it by the following code- Mage::app()->getCacheInstance()->flush();

    And, after flushing it reindex your data by-

    $indexingelement = array("cataloginventory_stock","catalog_product_attribute", ,"catalog_category_flat", "groupscatalog2_category","catalog_product_attribute","catalogsearch_fulltext","catalog_product_flat","catalog_product_price","catalog_url","catalog_category_product","groupscatalog2_product", "tag_summary");

    //reindex foreach ($indexingelement as $indexing) { echo $indexing.' is Reindexed'.'
    '; try { $process = Mage::getModel('index/indexer')->getProcessByCode($indexing); $process->reindexAll(); } catch(Exception $e) { echo 'Error occured while reindexing' . $indexing . '
    '; print($set->getMessage()); }