[Varnish] #1270: Any way to detect/distinguish ESI requests?

Varnish varnish-bugs at varnish-cache.org
Tue Feb 26 13:06:54 CET 2013


#1270: Any way to detect/distinguish  ESI requests?
----------------------+-------------------------
 Reporter:  whocares  |       Type:  enhancement
   Status:  new       |   Priority:  normal
Milestone:            |  Component:  varnishd
  Version:  3.0.3     |   Severity:  normal
 Keywords:            |
----------------------+-------------------------
 While playing with ESI I found that there seems to be no way to make
 Varnish distinguish between internal ESI and normal (= coming from a user)
 requests in vcl_recv(). What I'm trying to do is to add a special header
 and probably other stuff in a way like this:

 {{{
   if (req.isesi) {
      set req.http.X-Esi = "<nonce/hash/secret>";
   }
 }}}

 to any ESI requests so that the snippet to be included can actually make
 sure it was called through ESI processing and not directly by a user. I
 tried looking in the docs and also tried modifying the req.http. Headers
 for the ESI enabled pages in vcl_recv() as well as vcl_fetch() in the hope
 that the ESI requests would copy the headers from the original request but
 no luck there.
 Maybe I've done something wrong there but in any case I'd think that being
 able to detect ESI requests directly would be a much cleaner approach.

 -Stefan

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1270>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list