Welcome to PotatoCommerce - Top Quality 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. API allows admin to easily give FPC extension instruction to cache some other non-default page(s) or to treat some custom block as dynamic.

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

 



    
       ...
    
    
       ...
    
    
        ...
    

 

 

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
         
     

 

 

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

  1. Let’s tell FPC that content of block “cart_header” need to be treated as dynamic:

    
    
          
              
              
         
    
  2. Let’s tell FPC that content of block “cart.header” need to be treated as dynamic:

    
    
         
             
                 cart.header
             
         
    


  3. 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
             
         
    


 

 

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

1) Let’s tell FPC to cache all pages of “cms” module:



     
           
                
                      *
                      *
                
           
     

 

 

2) Let’s tell FPC that category page has a dynamic block added by widget or any other way via theme layout:



   
     
       
         
           
             widget_guest_form
             Potato_FullPageCache_Model_Processor_Block_Widget
             sales/widget_guest_form
             
             
               1