My requirement is to disable cache only for cms pages. So is there any way to achieve this functionality?
Asked
Active
Viewed 711 times
1
-
http://stackoverflow.com/questions/16852167/disable-full-page-caching-for-specific-block – Ravi Patel Feb 28 '14 at 12:49
1 Answers
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.
-
-
You can block any type of caching like this though not just `full_page` eg `block_html` – jzahedieh Feb 28 '14 at 12:57