php - Varnish ESI Request -- What Cookie Is Sent? -


new varnish, not new http. apologies if newbie/obvious territory, googling hasn't revealed answer.

when varnish makes request esi include url

  1. what cookie (and other request information) sending along default

  2. is programmatically controllable via vcl configuration file.

that -- it's understanding point of esi includes in varnish allow statefull information populated page pulled cache. statefull information (presumably) fetched application using session id, implemented via data sent in cookie.

what's not clear me if varnish passes along

  • the original request's cookie information
  • the application's response cookie
  • something else

and irrespective of varnish passes along default, can controlled in varnish vcl file?

(a php app, if matters)

just did digging around , seems cookies passed esi requests.

the esi requests processed varnish. allows process request headers , caching behavior again specific esi object.

at http://blog.lavoie.sl/2013/08/varnish-esi-and-cookies.html found following example. should allow unset / or leave cookies specific esi request.

sub vcl_recv {   if (req.esi_level > 0) {     # backend may want treat request differently     set req.http.x-esi-level = req.esi_level;      if (req.url !~ "esi-cookies=1") {       unset req.http.cookie;     }   } else {     unset req.http.x-esi-level; # remove security   } }  sub vcl_fetch {   # activate edge side includes, if x-esi header present   if (beresp.http.x-esi) {     set beresp.do_esi = true;     unset beresp.http.x-esi; # remove header   } } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -