I recently migrated my site to Acquia Dev Cloud hosting. They have Varnish installed by default as a load balancer/cacher. Since I am running Pressflow 6.20, I could theoretically use the external cache mode of Pressflow and take advantage of Varnish caching. However for my low traffic site I like the crawler feature and also the ability to expire pages easily that are in Boost.

My question is: If I use Boost in front of Varnish, what will happen? I assume it depends on the headers that Boost puts out. How will Varnish interpret the headers Boost would normally put out?

Note: I dont have easy access to change any of the Varnish settings.

Comments

ressa’s picture

My web host offered to enable Varnish for one of my web sites, and when I asked them if I should disable Boost, they recommended to keep using Boost, together with Varnish.

I didn't experience more problems than before Varnish was introduced, except the occasional Error 503 "Guru Meditation", but that might have happened regardless of whether Boost was there or not.

On the other hand, I didn't see any great improvements in page speed -- Boost by itself did an amazing job!

Fabianx’s picture

Hi,

You might be interested in my proposed session for Drupal Con London:

http://london2011.drupal.org/conference/sessions/boosted-varnish-how-inc...

--

To answer this in short:

Boost will not conflict with varnish, but also not be speeded up by it (besides for static assets if properly configured).

Varnish will only make boost a lot faster and with less load on the server, if it is configured for it.

By standard boosted apache pages will set a "Expired: 1978" and such invalidating any varnish cache.

By default varnish will not cache this.

By standard drupal will also send a SESSION cookie for any page not boosted and then by default the varnish cache is completely circumvised (even for assets if the cookie is not specifically deleted for them).

However it is possible to still cache boosted pages for an hour via the magic marker method and by using some logic inside varnish, which resembles the boost logic.

I'll detail the approach in a blog post after Drupal Con London.

Best Wishes,

Fabian

timani’s picture

Issue tags: +boost, +cache, +varnish

Was this session ever accepted? or is it archived online somewhere, it would be an interesting topic? The link seems to have expired, I got an access denied.

Fabianx’s picture

Hi timani27,

It was not accepted, but I wrote a blog post about it:

http://www.trellon.com/content/blog/boosted-varnish-high-performance-cac...

I released the module at the BoF at Drupal Con London.

I have a Drupal 7.x version in the works.

bgm’s picture

Status: Active » Fixed

Boost and Varnish are two complex solutions, I would really not recommend to combine them unless you have a good experience with both. On many high traffic sites, both solutions work well for me.

Varnish has an advantage of being external, so you can easily have more than one instance behind a load balancer. It's a good and inexpensive way to have a redundant setup. You can also have a generic Varnish backup setup, and point your sites from a shared hosting to that Varnish when a site is receiving lots of traffic (if that traffic is only in occasional peaks and you do not want it behind Varnish all the time because it might glitch now and then, causing another point of failure; or if you want to avoid saturating the cache with low traffic sites). Another advantage is that your cache is not using the resources from your main server (ram / disk IO).

And you should really use Pressflow with Varnish. As Fabianx pointed out, the default Drupal-core is not very friendly with Varnish because it sets a cooking for anonymous users.

You might also be interested in the expire project.

Boost has the advantage of being easy to setup and works in many hosting environments.

There's no one-size-fits-all when it comes to caching :)

bgm’s picture

ressa’s picture

Disregard, sent to wrong post.

Automatically closed -- issue fixed for 2 weeks with no activity.