Have a Need for Speed?Posted: January 7, 2012 under Drupal, Web Performance
I returned from a long vacation over the holidays to discover that one of the sites that I manage had developed some serious performance issues. Page load times had gone from 1 or 2 seconds to more than 8 seconds on some of the slowest loading pages.
After messing around with a few of the usual suspects, I decided to give the Drupal Boost module a try in hopes that it would speed up the site while I worked on tracking down the underlying issue.
Getting Started With Drupal Boost
If you're not familiar with the Boost module, it works by caching the pages on your site as HTML files. This essentially takes PHP processing out of the loop on subsequent page requests, potentially delivering a big performance improvement. Keep in mind, however, that Boost only works for anonymous users. So if you're logged in to your site, you're not going to notice anything.
Another point I'd like to make is that the first site I implemented Boost on was a Drupal 6 installation. This is an important point because like so many other contributed modules, Boost is still a development release for Drupal 7.
That being said, I'm going to include screenshots of the subsequent installation I performed on Drupal 7. Before you start shaking your head in dismay at my recklessnesss, consider that the project page notes that the Boost module is ready for D7 if you use just the basic features, so I figured it was worth a shot.
Another reason I wanted to try out Boost on Drupal 7 is that unlike some other caching methods, Boost works well in a hosted environment. So if you have a sluggish Drupal 7 site in a hosted environment, taking a chance on Boost might just be worth it. But if you decide to give this module a try on Drupal 7, please be sure to backup your site first.
The project page offers you two options as far as instructions go. You can read the full instructions or you can fix the errors and warnings on the status report page. I like doing things the easy way as much as the next guy, so I chose the latter method. So if you'd like to follow along, download Boost, unzip the folder into your modules directory and enable it as usual.
Once I had the module enabled I went to admin/reports/status and saw the message in the screenshot below. If you don't see the same thing, you'll probably have a few errors or warnings to take care of that may include enabling a couple Apache modules or adding a line to your robots.txt file.
Your next stop should be the Boost configuration page. I should note here that the configuration options for the Drupal 6 version of the module are much more extensive than for D7, at least at the time of this writing. The configuration options on the Drupal 6 version can be a little overwhelming, sort of like the first time you try Views.
Unfortunately, the installation process was not without some hiccups on Drupal 6. I eventually had to disable GZip compression because some page elements kept disappearing after 20-30 minutes of clearing the cache. GZip compression isn't yet a part of the D7 version of the module, so no worries there.
On D7, this is your config page:
I won't get into all of the tabs in this post because, like I said, I left everything at the defaults. But the last big piece of the the installation process is adding rules to your .htaccess file. Boost makes this very simple. There is a tab on the configuration screen labeled, ".HTACCESS". You'll be presented with a block of rules that you simply place in your .htaccess file and you should be all set.
So What Are the Results?
You're probably curious about what sort of performance boost I got. It was pretty impressive, certainly worth the small amount of time I invested setting things up. The home page had been taking 2.2 seconds to load. That time was cut to 0.4 seconds - less than a fifth the previous load time! A simple 'About Us' page on the site had been taking 4.2 seconds to load and that was cut to 1.6 seconds. Pretty sweet, huh?
Now I certainly don't advocate papering over performance issues caused by problems with server configuration or poorly coded modules, but the Drupal Boost module can provide a really nice improvement in page load times. It was enough in my case to let me investigate the underlying issue without worrying so much about users having a bad experience on the site.
I'd love to hear about your experiences with Boost or some of the other caching modules.