Varnish5 builtin VCL without pipe

Kristian Grønfeldt Sørensen ksorensen at nordija.com
Wed Apr 6 15:47:26 CEST 2016


On ons, 2016-04-06 at 08:27 +0000, Poul-Henning Kamp wrote:
> Can we make builtin::vcl_recv{} look like this in Varnish5 ?
> 
> sub vcl_recv {
>     if (req.method == "PRI" ||          /* HTTP/2.0 */
>       req.method == "CONNECT" ||
>       req.method == "OPTIONS" ||
>       req.method == "TRACE") {
>         return (synth(405));
>     }
>     if (req.method != "GET" && req.method != "HEAD") {
>         /* We only deal with GET and HEAD by default */
>         return (pass);
>     }
>     if (req.http.Authorization || req.http.Cookie) {
>         /* Not cacheable by default */
>         return (pass);
>     }
>     return (hash);
> }
> 

I was actually going to suggest that Varnish5 should default to pass()
PATCH requests rather than piping them, but this change seems to take
care of that, so I think it's a good idea.

BR

Kristian Sørensen



More information about the varnish-dev mailing list