Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable/Bypass Magento Full Page Cache on single page

How can I disable or bypass FPC for a single page? I don't want to use hole-punching as there are several blocks on the page that I need to be dynamic and I would rather modify one config/class to specify that the entire page should not be cached (similar to the behavior of checkout).

My understanding of FPC was that it was not used for "session users" (logged in, added to cart, etc...). However, I'm seeing FPC affect pages when a user is logged in. If I disable FPC, then the page works as desired.

like image 647
Joe Constant Avatar asked Dec 06 '11 18:12

Joe Constant


1 Answers

Just got done wrestling with Magento EE FPC not displaying core messages on cached CMS pages. Core messages worked fine on cache category and product pages but not CMS pages. I found by passing a certain parameter to a page you can force that pages to be generated instead of server out of the cache.

found in: app/code/core/Enterprise/PageCache/Model/Processor/Default.php

/**
 * Disable cache for url with next GET params
 *
 * @var array
 */
protected $_noCacheGetParams = array('___store', '___from_store');

So it is possible to make a link that has a HTTP GET query string that would bypass the FPC.

http://www.domain.com/?___store

This helped solve a problem I was having were a plugin was redirecting to a referring url with a session message but if the referrer was a CMS page the message would not be displayed until a non-CMS page was viewed.

like image 187
Ian at Xantek Avatar answered Sep 28 '22 21:09

Ian at Xantek