1

My requirement is to disable cache only for cms pages. So is there any way to achieve this functionality?

MagentoDev
  • 109
  • 1
  • 5

1 Answers1

0

You need to rewrite / modify Mage_Cms_PageController models preDispatch method.

public function preDispatch() {
    $cache = Mage::app()->getCacheInstance();

    // Tell Magento to 'ban' the use of FPC, can also ban other types such as 'block_html'
    $cache->banUse('full_page');

    parent::preDispatch();
}

The better, cleaner and safer option than rewriting this controller is to use observers, these look at these events:

controller_action_predispatch
controller_action_predispatch_' . $this->getRequest()
controller_action_predispatch_' . $this->getFullActionName()

See Disable/Bypass Magento Full Page Cache on single page for more information.

Community
  • 1
  • 1
jzahedieh
  • 1,570
  • 1
  • 15
  • 27