0 votes
470 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 308 views
0 votes
2 answers 1k views
asked Oct 26, 2016 in Modules by Octavia
0 votes
1 answer 510 views
+1 vote
1 answer 1.7k views
0 votes
1 answer 5.2k views
+1 vote
1 answer 2.9k views
...