Hi List,<div><br></div><div>Yesterday with Varnish users help (thanks again guys), I succeeded with an extreme simplicity to solve the problem I described here:</div><div><a href="http://lists.varnish-cache.org/pipermail/varnish-misc/2010-July/004428.html">http://lists.varnish-cache.org/pipermail/varnish-misc/2010-July/004428.html</a></div>
<div><br></div><div><div>Today, I've a new challenge for Varnish to extend the capabilties of my customserver !!!</div><div><br></div><div>My current "customserver.vcl" contains 2 backends:</div><div><div>backend squid {</div>
<div> .host = "127.0.0.1";</div><div> .port = "3128";</div><div>}</div><div><br></div><div>backend customserver {</div><div> .host = "127.0.0.1";</div><div> .port = "80";</div><div>
}</div><div><br></div><div>sub vcl_recv {</div><div> // set default backend</div><div> set req.backend = squid;</div><div><br></div><div> if (req.http.X-RAWDATA != "") {</div><div> set req.backend = customserver;</div>
<div> }</div><div>}</div></div><div><br></div><div>Challenge:</div><div><br></div><div><div>1. If an HTTP request arrives with a special header "X-STORE-IN-FILE: UUID",</div><div>I'd like Varnish to get the response data from "squid" backend, save the "raw HTTP response" on disk under filename "UUID" before sending it back to the client.</div>
<div><br></div></div><div>2. If (1) is doable, I'd like Varnish to save both "raw HTTP request and response" (by "raw", I mean HTTP hearders and payload) in the file "UUID".</div><div><br>
</div><div>Any pointer, hint, or piece of VCL will be very welcome!</div><div>Thanks in advance.</div><div><br></div><div>NOTE: UUID is a Universally Unique Identifier used in my context to have unique filenames on disk.</div>
<div><br></div>-- <br>Regards<br>Zab<br>
</div>