0

I need to flush only block HTML of Magento 1,9

If I write

try {

Mage::app()->getCacheInstance()->cleanType('block_html'); 

 } catch (Exception $e) {
        die("[ERROR:" . $e->getMessage() . "]" . PHP_EOL);
 }

It's correct?

1
  • Accept the answer If you find it helpful
    – Keyur Shah
    Jan 25, 2018 at 17:35

2 Answers 2

1

If you have **Magerun n98 installed, you can do this from SSH.

All commands try to detect the current Magento root directory. If you have multiple Magento installations you must change your working directory to the preferred installation.

To view the status of the cache, enter:

php n98-magerun.phar cache:status

You can flush specific type of cache by entering:

php n98-magerun.phar cache:flush [type] ... [type]

In your case:

php n98-magerun.phar cache:flush block_html

Also, you can run this command if you don't have Magerun:

php -r 'require "app/Mage.php"; Mage::app()->getCacheInstance()->flush(block_html);'
1
Mage::app()->getCacheInstance()->cleanType(Mage_Core_Block_Abstract::CACHE_GROUP);

Where Mage_Core_Block_Abstract::CACHE_GROUP is block_html you can pass different type of cache also, like

  • block_html
  • collections
  • config
  • layout
  • translate
  • eav
  • config_api
  • config_api2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.