New challenge for Varnish!

Rob S rtshilston at gmail.com
Thu Jul 8 08:28:40 CEST 2010


Zab,

I don't think that's going to be possible with a pure VCL approach.  Can 
you give us a better idea of exactly what you're trying to achieve, as 
there might be a simpler / more Varnish-friendly way of achieving what 
you're after.

You can certainly use varnishlog to see the full headers for a given 
UUID, but the body content is more difficult.

Rob

zabrane Mikael wrote:
> Hi List,
>
> Yesterday with Varnish users help (thanks again guys), I succeeded 
> with an extreme simplicity to solve the problem I described here:
> http://lists.varnish-cache.org/pipermail/varnish-misc/2010-July/004428.html
>
> Today, I've a new challenge for Varnish to extend the capabilties of 
> my customserver !!!
>
> My current "customserver.vcl" contains 2 backends:
> backend squid {
>   .host = "127.0.0.1";
>   .port = "3128";
> }
>
> backend customserver {
>   .host = "127.0.0.1";
>   .port = "80";
> }
>
> sub vcl_recv {
>   // set default backend
>   set req.backend = squid;
>
>   if (req.http.X-RAWDATA != "") {
>         set req.backend = customserver;
>   }
> }
>
> Challenge:
>
> 1. If an HTTP request arrives with a special header "X-STORE-IN-FILE: 
> UUID",
> 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.
>
> 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".
>
> Any pointer, hint, or piece of VCL will be very welcome!
> Thanks in advance.
>
> NOTE: UUID is a Universally Unique Identifier used in my context to 
> have unique filenames on disk.
>
> -- 
> Regards
> Zab
> ------------------------------------------------------------------------
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc





More information about the varnish-misc mailing list