Mitech Preloader
Magento

Magento Hole Punch With Varnish Cache

Table of Contents

If You want to exclude your custom block from varnish cache then follow below solution.

[php]
<reference name=”block name”>
<action method=”setEsiOptions”>
<params>
<access>private</access>
<flush_events>
<wishlist_item_save_after/>
<wishlist_item_delete_after/>
<sales_quote_save_after/>
</flush_events>
</params>
</action>
</reference>
[/php]

OR

[php]
<reference name=”block name”>
<action method=”setEsiOptions”>
<params>
<access>private</access>
<ttl>0</ttl>
</params>
</action>
</reference>
[/php]

OR

[php]
<reference name=”block name”>
<action method=”setEsiOptions”>
<params>
<access>private</access>
<method>ajax</method>
</params>
</action>
</reference>
[/php]

We only have one parameter called <access></access>. This parameters indicates to Magento which type of caching we want on the block. In this case, the type of caching is private. private means that we want Varnish to cache a different version of the <block></block> for each client.
If you want to exclude URL then see below solution.

[php]
<checkout_onepage_index>
<turpentine_cache_flag value=”0″/>
</checkout_onepage_index>
[/php]

blank