Varnish 301 Redirect

Varnish logo

Note (as of August 30, 2017): The original post was published for Varnish 3. A lot changed since then. Currently, we have a nicer way to achieve 301 redirects. Thanks!

Varnish logoVarnish is a powerful caching HTTP reverse proxy server. It can sit in front of Apache or Nginx and can cache the requests that are configured to be cached. Varnish offers a lot of flexibility on what to cache and what not to cache. However, it doesn’t offer any simple redirection by default. When it stands in front of a general purpose web server, it sends the requests to the backend (in our case, Nginx), and then sends the backend response to the browser. While this is the natural process, there are a couple of ways to reduce this round-trip and save a bit of time. After all, every millisecond counts! Continue reading “Varnish 301 Redirect”