Using obj.hits, clearly a hit and miss affair

VCL is awesome, but it's also a bit frightening to newcomers, and most of the time, people are more interested in something that "just works"™ than "doing the right thing"™ and they google their way out of it.

Problem is that the first thing that sort of works isn't necessarily the right thing, and the proliferation of one particular code snippet is what prompted the writing of this post. The snippet in question? This guy:

sub vcl_deliver {
    if (obj.hits > 0) {
        set resp.http.X-Cache = "HIT";
    } else {
        set resp.http.X-Cache = "MISS";
    }
}

Recognize it? Have it somewhere in your code, maybe? If so, read on, and let's try to do the right thing, and hopefully, get a better setup thanks to it. Don't worry, this is a short one, so hop in.

Read More

7/26/18 1:00 PM
by Guillaume Quintard

Introducing Varnish DIY CDN

Not so long ago and not so far away, the idea of building your own CDN was a complex, remote and expensive proposition, requiring more technical expertise than most companies delivering digital content wanted to commit when there were perfectly reasonable commercial CDN options available.

Read More

3/8/18 3:00 PM
by Erika Wolfe

Varnish Software Blog

The Varnish blog is where our team writes about all things related to Varnish Cache and Varnish Software...or simply vents.

 

 
 

Posts by Topic

see all
 

SUBSCRIBE TO OUR BLOG