Search code examples
magentovarnishhole-punching

Magento Hole puch With Varnish


I recently installed the varnish 3.x in system (ubuntu) and configured it to 8080.

Now full page caching is enabled and its working fine. I just want to ignore some specific dynamic blocks of the page. How can i do with magento. Also i am not using Magentos default caching techniques so i disabled it. also tried module Terpentine

Thanks & Regard

Rajesh Ganjeer


Solution

  • I have done this using

    Try this in local.xml inside the app/design/frontend/XXX/XXX/layout/local.xml file:

    <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>`
    

    OR

    <reference name="block name">
        <action method="setEsiOptions">
            <params>
                <access>private</access>
                <ttl>0</ttl>
            </params>
        </action>
    </reference>`
    

    OR

    <reference name="block name">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <method>ajax</method>
        </params>
    </action>
    </reference>`
    

    OR

    Whole page will ignore cached eg. one page module checkout_onepage_index

    <checkout_onepage_index>
        <turpentine_cache_flag value="0"/>
    </checkout_onepage_index>
    

    I tried this using module Nexcessnet Turpentine. and it works

    For your reference after Turpentine installation :

    app/design/frontend/base/default/layout/turpentine_esi.xml

    Thanks a lot for your feedbacks.

    Reference Sites :

    http://www.magentocommerce.com/magento-connect/turpentine-varnish-cache.html

    https://github.com/nexcess/magento-turpentine

    Thanks & Regards

    Rajesh Ganjeer