Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Drupal 6 Varnish Installation (Pressflow)

Walkthrough

1) Install Pressflow

This should be relatively seamless; don't be afraid just to replace your entire Drupal core with Pressflow and simply drop your sites/ directory in. The extra prudent might run Hacked just to make sure core hasn't been altered, but I say move fast and break things.

...

Install the Varnish module and insert your Varnish Control Key (should be in /etc/varnish/secret) in the module config page (admin/settings/varnish/general). 

Additional Resources

https://groups.drupal.org/node/25425

 

Varnish Configuration Tips

Nate Haug has a good article explaining what the config variables mean and giving some good starter tips: https://www.lullabot.com/blog/article/configuring-varnish-high-availability-multiple-web-servers

Using "Grace"

To enable Grace, you just need to specify the setting invcl_recv and in vcl_fetch:

 

# Respond to incoming requests.
sub vcl_recv {
  # Allow the backend to serve up stale content if it is responding slowly.
  set req.grace = 6h;
}

# Code determining what to do when serving items from the Apache servers.
sub vcl_fetch {
  # Allow items to be stale if needed.
  set beresp.grace = 6h;
}

Both of these settings can be the same, but the setting in vcl_fetch must be longer than the setting in vcl_recv. Think of the vcl_fetch grace setting as "the maximum time Varnish should keep an object". The setting in vcl_recv on the other hand defines when Varnish should use a stale object if it has one.