Welcome to PotatoCommerce - Magento Extensions Store

Home > Blog > Full Page Cache API

How to exclude block from caching by Full Page Cache?
Using hole-punching feature guide.

Posted on 19 December 2016

Our Full Page Cache extension works great for default Magento pages and functionality. However, there is often a necessity to make a compatibility with some 3rd-party module.

FPC API allows to give FPC extension instruction to treat some block as dynamic. FPC API can also be used to cache some non-default page(s).



Configuration Files

You can find initial settings of FPC extension at app/code/community/Potato/FullPageCache/etc/po_fpc.xml.
Additional settings can be placed in an appropriate folder for each 3rd party extension, e.g. app/code/community/Mage/CustomModule/etc/po_fpc.xml or at app/code/community/Potato/FullPageCache/etc/custom.xml


	
		
			...
		
		
			...
		
		
			...
		
	





include_to_page_cache_id

Section include_to_page_cache_id is not required. It allows adding an additional identifier to Cache ID.
An example of usage:


	
		
			
				Potato_Core_Helper_Data::isMobile
			
		
	





session_blocks

Section session_blocks is required. It allows giving FPC extension instructions to update some unique dynamic content of some certain customer. Examples of usage:

Let's tell FPC that content of block cart_header need to be treated as dynamic:


	
		
			
			
		
	





Treat some block as dynamic

Let's tell FPC that content of block cart.header need to be treated as dynamic:


	
		
			
				cart.header
			
		
	





Treat some block as dynamic (with an individual processing)

Let's tell FPC that content of block cart.header need to be treated as dynamic, and requires an individual processing:


	
		
			
				cart.header
				Custom_Module_Model_Processor_Block_Session_CartHeader
			
		
	





allowed_routers — cache non-default pages

Section allowed_routers is required. It allows giving instructions to FPC extension the list of pages allowed for caching.
An example of usage:

Let's tell FPC to cache all pages of cms module:


	
		
			
				
					*
					*
				
			
		
	





Widget caching

Let's tell FPC that a category page has a dynamic block, which was added as widget, or another way in theme layout:


	
	
	
	
		
			
				widget_guest_form
				Potato_FullPageCache_Model_Processor_Block_Widget
				sales/widget_guest_form
				
				
					1