I'm struggling to find a way to completely disable varnish for logged in users using the Turpentine extension.
I have a member based site, non-logged in guests can browse products but not see prices or order. Logged in members of course can.
I'm trying to use Varnish so the large numbers of non-members visiting the site don't impact the performance on the relatively small number of logged in members.
Out of the box once varnish is working properly with Turpentine the problem is that the product information starts to be cached and becomes visible to non-logged in users, or vice versa - a guest view can be shown to a logged in user.
So the question is:
Is there a block level syntax that can be added to local.xml or turpentine_esi.xml that will disable all caching for a logged in user?
Here's what I've tried
Using my themes local.xml at first I tried shifting all the product_list blocks into a private ESI like this
... <catalog_category_default> <reference name="product_list"> <action method="setEsiOptions"> <params> <access>private</access> <scope>page</scope> <flush_events> <checkout_onepage_controller_success_action/> <sales_quote_save_after/> </flush_events> </params> </action> </reference> </catalog_category_default>
However that returns the same "no products found" message to all visitors and even if I had got that working the number of blocks to shift over to private would become huge as I tried to catch every scenario where members only info might appear - even if I managed to find them all I could imagine the varnish caching and flushing could create more load than not having it at all.
Next I tried disabling caching entirely for members - my prefered option anyway
<customer_logged_in> <turpentine_cache_flag value="0"/> </customer_logged_in>
That didn't seem to have any effect at all, I was still getting cached content, and cached content was 'bleeding' between users.