Question regarding vcl config

Johan Hendriks neuteboom.log at
Sat Sep 26 16:39:30 UTC 2020

Hello all, I have inherited a varnish server. And I am a little confused
about a few lines in that config.

It has the following in vcl_recv

    # Don't cache if there are request cookies
    if (req.http.Cookie) {
        set req.http.X-Debug-Varnish-Nocache-Recv = "Got request cookie ("
+ req.http.Cookie + ")";

        return (pass);

    if (req.url ~
"\.(png|gif|jpg|jpeg|ico|swf|css|js|pdf|ico|js|ogg|mp4)$") {
        unset req.http.cookie;
    if (req.url ~ "^/(includes|images|templates)") {
        unset req.http.cookie;

So the first if block tells request with req.http.Cookie to pass to the
The second tells if the requested url ends with
.png|gif|jpg|jpeg|ico|swf|css|js|pdf|ico|js|ogg|mp4 and so on to unset the
But will these rules be executed or is the request already passed to the

Thanks for your time
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list