varnish Posts

A Varnish 4 VCL for Drupal 7

This is an interweaving of Four Kitchens' Varnish 3 VCL and this generic Varnish 4 VCL.


vcl 4.0; # Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl import std; import directors; backend server1 { # Define one backend .host = "127.0.0.1"; # IP or Hostname of backend .port = "8080"; # Port Apache or whatever is listening .max_connections = 300; # That's it .probe = { #.url = "/"; # short easy way (GET /) # We...

Brain Dump - Drupal and Fastly

Prelude

Fastly is a CDN (content deliver network). A CDN makes your site faster by acting as a caching layer between the world wide web and your webserver. It does this by having a globally distributed network of servers and by using some DNS trickery to make sure that when someone puts in the address of your website they're actually requesting that page from the nearest server in that network.

$ host www.ecnmag.com
www.ecnmag.com is an alias for...

The default Fastly VCL

I screwed this one up pretty bad when I first got started with Fastly. That have that link that says "VCL", as if you should download that to get started. So I did. But that's the generated VCL, and all their special macros are already blown up, so you don't want to copy that one.

And the one on their website has HTML entities encoded, so I'm putting this one here in case I need it again later.

The original

sub vcl_recv {
#FASTLY recv

    if (req.request != "HEAD" && req.request !=...