What does Varnish hit-for-pass mean?

A hit_for_pass object is made to optimize the fetch procedure against a backend server. For ordinary cache misses, Varnish will queue all clients requesting the same cache object and send a single request to the backend. This is usually quickest, letting the backend work on a single request instead of swamping it with n requests … Read more

Custom 503 Error Page With Varnish

The Varnish FAQ suggests using vcl_error for this (and it’s how I’ve done it): This is the default VCL for the error page: sub vcl_error { set obj.http.Content-Type = “text/html; charset=utf-8″; synthetic {” <?xml version=”1.0″ encoding=”utf-8″?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html> <head> <title>”} obj.status ” ” obj.response {“</title> </head> <body> <h1>Error … Read more

How to check if chosen Varnish cache size is ideal?

I found the solution: You can monitor how much of the maximum cache size (512 MB in this case) that Varnish has allocated by running varnishstat. Then look for the output lines “bytes allocated” and “bytes free”. The following relation holds: Command line configuration of max size = [bytes allocated] + [bytes free] Depending on … Read more

Varnish Cache – default TTL?

This is in the default template: sub vcl_fetch { if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == “*”) { /* * Mark as “Hit-For-Pass” for the next 2 minutes */ set beresp.ttl = 120 s; return (hit_for_pass); } return (deliver); } So, 120 seconds.