ESI works in IE6 & curl, but not in FF, Opera, Konqueror

Torstein Krause Johansen torstein at
Thu Nov 6 10:20:46 CET 2008

Hi all,

I cannot get ESI to work for any "real" browser, it might be something 
really obvious I've missed, but it seems really odd to me.

backend default {
     .host = "";
     .port = "81";

sub vcl_fetch {
     if (req.url ~ "esiTest.html") {
         set obj.ttl = 24 h;
     elseif (req.url == "/cgi-bin/date.cgi") {
         set obj.ttl = 1m;

esiTest.html (copied from varnish web site):
<html xmlns="">
     The time is: <esi:include src="/cgi-bin/date.cgi"/>
     at this very moment.

date.cgi (copied from varnish web site):

echo 'Content-type: text/html'
echo ''
date "+%Y-%m-%d %H:%M"

I've included everything here so you can see there's no copy/paste 
errors :-) Backend is Apache HTTPd 2.2.

Now to the odd bit, this works in IE6, curl and wet, but not in browsers 
like Firefox (Iceweasel), Konqueror or Opera.

It seems that the "Accept-encoding" header the client sends (or doesn't 
send in curl's case) to Varnish is the crucial bit, but of course I'm 
not sure. It _does_ influence the curl result though, setting it to the 
same as what Iceweasel sends to Varnish messes up the results (only 
garble comes back).

Here's the output from when Iceweasel tries to access the esiTest.html 

And here's the output from curl, which works:

So, please tell me what I need to do to make this work, and no, using IE 
is not an option ;-)

Best regards,


More information about the varnish-misc mailing list