Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to correctly remove ESI options set in turpentine_esi.xml #951

Closed
rossmc opened this issue Sep 17, 2015 · 6 comments
Closed

How to correctly remove ESI options set in turpentine_esi.xml #951

rossmc opened this issue Sep 17, 2015 · 6 comments

Comments

@rossmc
Copy link

rossmc commented Sep 17, 2015

I'm wondering what is the best practice to remove the ESI options set in turpentine_esi.xml?

To give some context I found that after I installed the turpentine module & got it working with Varnish, my dynamic cart my header was not working, it was displaying the default Magento topcart and not the one from our theme.

While debugging the issue I found if I removed the below code block from turpentine_esi.xml my dynamic cart started working properly, correctly holding the number for cart items for each user.

<reference name="cart_sidebar">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <flush_events>
                <sales_quote_save_after/>
            </flush_events>
        </params>
    </action>
</reference>

I believe that as the our theme's topcart is defined in the header this is why it continued to work after removing the above code, infact when I removed the header esi options set in turpentine_esi.xml I could see that my dynamic cart broke, not holding the correct number of items for each user.

So my question is how do I remove the cart_sidebar block from turpentine_esi.xml without deleting it from that file? Can I put something in my own layout local.xml which would remove it so I can maintain upgrade-ability?

@aricwatson
Copy link
Contributor

I'm actually working up a way to do this via config in local.xml, will hopefully merge it into devel today or tomorrow.

@aricwatson
Copy link
Contributor

I've just merged #970 which allows you to override the settings in turpentine_esi.xml via your local.xml config:

 <reference name="header">
    <action method="setEsiOptions">
        <params>
            <disableEsiInjection>1</disableEsiInjection>
        </params>
    </action>
</reference>

Unless problems pop up, this will be in the next update of master!

@addison74
Copy link

This is a great solution. Is it included in Wiki?

@aricwatson
Copy link
Contributor

Thanks - I will update the docs once it's live in the master branch.

@aricwatson aricwatson added the docs label Oct 2, 2015
@rossmc
Copy link
Author

rossmc commented Oct 3, 2015

Thanks @aricwatson, nice work

@aricwatson
Copy link
Contributor

This has been added to the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants