[Varnish] #782: expose sp->esis to vcl (patch attached)
Varnish
varnish-bugs at varnish-cache.org
Mon Dec 6 05:40:17 CET 2010
#782: expose sp->esis to vcl (patch attached)
-------------------------+--------------------------------------------------
Reporter: askalski | Owner: kristian
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: build | Version: trunk
Severity: normal | Keywords: esi
-------------------------+--------------------------------------------------
Comment(by blakefrost):
The original patch wasn't working for me because the modified files were
being over written during the make install. I moved the changes to the
source for the generated files. This patch should now apply cleanly and
work as advertised.
I would like to second askalski request for this patch to be incorporated.
Exposing this variable allows for the important distinction between the
initial request and esi requests. This is handy if you'd like to modify
one or the other but not both. A pattern I follow is to return all
dynamically generated content in the first response and esi blocks to fill
in with static/shared/cached content. In order to enable cacheing for the
esi parts cookies must be cleared prior to the esi request but not before
the initial request. This is where req.esis comes in which makes it
trivial to do so.
I've include the vcl_recv and vcl_feth implementation I use to accomplish
the above.
{{{
sub vcl_recv {
if (req.esis > 0) {
unset req.http.cookie;
}
}
sub vcl_fetch {
if (beresp.http.Content-Type ~ "text/html") {
esi;
}
}
}}}
--
Ticket URL: <http://varnish-cache.org/trac/ticket/782#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list