Clean the cache in magento


1 . How the above code will work ? it will remove all the cache or any particular instance or page. suppose I will add this code on any block initialization code like below.

class Fishpig_Wordpress_Block_Sidebar_Widget_Menu
     * Generate the Menu HTML
     * @return $this
    public function _beforeToHtml()

        $menuBlock = $this->getLayout()->createBlock('wordpress/menu')


        return $this;

It will clear all the cache types, the same as if you'd checked all the cache types under "Cache Management" - see this question for details.

If you put that into your block initialization code, you'll be clearing your cache every time Magento runs that code... might not be ideal!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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