0 votes
487 views
asked in Magento by
How to clear Magento cache/reindex programmatically?

1 Answer

0 votes
answered by
<?php
// clear cache
Mage::app()->removeCache('catalog_rules_dirty');
// reindex prices
Mage::getModel('index/process')->load(2)->reindexEverything();
/*
1 = Product Attributes
2 = Product Attributes
3 = Catalog URL Rewrites
4 = Product Flat Data
5 = Category Flat Data
6 = Category Products
7 = Catalog Search Index
8 = Tag Aggregation Data
9 = Stock Status
*/
?>

Related questions

0 votes
0 answers 341 views
0 votes
2 answers 1.2k views
asked Oct 26, 2016 in Modules by Octavia
0 votes
1 answer 550 views
+1 vote
1 answer 5.1k views
0 votes
1 answer 11.2k views
+1 vote
1 answer 4.7k views
...