Drupal blocks as Edge Side Includes
What are Edge Side Includes?
These are just a way to tell your reverse proxy (Varnish) that some parts of the page should get some special attention. For example a shorter expire time (TTL) or if they should be cached by USER, PAGE or by ROLE. If you know your site well enough, you can provide some caching for authenticated users this way. Especially in combination with the block cache alter module. Beneath is an example how an ESI include could look like for a block in Drupal:
<div> <esi:include src="/esi/block/garland:col_right_middle:block:0/ZnJvbnQ=/CACHE=USER"> </div>
So, there's a module for that?
Yes, there is a ESI module for Drupal. But it is pretty cutting edge, beta, and at time of writing not very up-to-date with the latest VCL syntax for Varnish 2.1. So you should at least apply this patch. In my case I also made some paches to make it work with the context module. But my guess is the code will get refactored soon as this is only phase 1.
Update february 2011: