Skip to content

Instantly share code, notes, and snippets.

@cosimo
Created April 19, 2013 09:05
Show Gist options
  • Save cosimo/5419092 to your computer and use it in GitHub Desktop.
Save cosimo/5419092 to your computer and use it in GitHub Desktop.

When varnish logs a Hit entry (SLT_Hit), it means the vcl_recv() function has given a go for serving the request from cache and the object is available.

This however doesn't guarantee that our request was served from the cache. The default vcl_hit() code (man vcl) checks that the object has to be cacheable too, at least on varnish 2.1.

if (!obj.cacheable) {
    return(pass)
}

vcl_hit() could still return pass, in which case the request is definitely a miss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment