File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public function handleControllerFrontSendResponseBefore(Varien_Event_Observer $o
2525 $ params = $ paramProvider ->baseParams (true ) + array (
2626 'type ' => $ type ,
2727 'route ' => $ this ->trackerRoute (),
28+ 'cacheable ' => $ this ->isRequestCacheable ()
2829 );
2930
3031 $ factory = Mage::getModel ('mpchadwick_pagecachehitrate/trackerFactory ' );
@@ -40,6 +41,20 @@ public function handleControllerFrontSendResponseBefore(Varien_Event_Observer $o
4041 }
4142 }
4243
44+ /**
45+ * Determine this request is cacheable in FPC
46+ *
47+ * @return bool
48+ */
49+ protected function isRequestCacheable ()
50+ {
51+ $ request = Mage::app ()->getRequest ();
52+ $ processor = Mage::getSingleton ('enterprise_pagecache/processor ' );
53+ $ subprocessor = $ processor ->getMetadata ('cache_subprocessor ' );
54+
55+ return $ subprocessor !== null && $ processor ->canProcessRequest ($ request );
56+ }
57+
4358 /**
4459 * Get the type of response.
4560 *
You can’t perform that action at this time.
0 commit comments