ESIs with Varnish 2.1.5 for Anonymous Users We're trying to configure our sites running D7 to use ESIs with Varnish 2.1.5, and having a hard time figuring this out. 

We have a file /test.php that is being included in the template via esi so it appears on all pages of our site. The call to the file is through (in the template)

&lt;esi:include src="/test.php" /&gt;


Relevant vcl conf is:

sub vcl_fetch {
...
  // enable esi
  esi;
  // if url is test.php, set ttl to 15 s
  if (req.url == "/test.php") {
    unset beresp.http.set-cookie;
    set beresp.ttl = 15s;
  }
}


The text from test.php appears when users are logged in, but does not appear when they are logged out -- which is what we're after. This is without the ESI module as that is for authenticated users.
Try turning off Anonymous caching and see what results you get (caching should be handled by Varnish).


Go to admin/config/development/performance
Uncheck Cache pages for anonymous users