ESI & Cookies questions

Cloude Porteus cloude at instructables.com
Tue Mar 3 23:41:19 CET 2009


When an ESI request is made/fetched, will the page get passed all the
request headers and cookies? For example, would I be able to access
our domain cookies in "/cgi-bin/date.cgi" for the example below.

sub vcl_fetch {
    if (req.url == "/test.html") {
        esi;  /* Do ESI processing */
        set obj.ttl = 24 h;
    } elseif (req.url == "/cgi-bin/date.cgi") {
        set obj.ttl = 1m;
    }
}

Do I have access to the cookies when evaluating my ESI processing, so
we could give users a cached version or not based on their cookie?
Something like this:

sub vcl_fetch {
    if (req.url == "/test.html") {
        esi;  /* Do ESI processing */
        set obj.ttl = 24 h;
    } elseif (req.url == "/cgi-bin/date.cgi") {
               if(req.http.Cookie ~"(APPSERVER)") {
               set obj.ttl = 30m;
               } else {
                      pass;
              }
       }
}

It also looks like GZIP support is on the list of post 2.0 features.
This is critical as we only have a load balancer in front of Varnish
and would rather not put the load of gzip'ing all of our pages that
require ESI.

Thanks for any information on the above.

best,
cloude



More information about the varnish-dev mailing list