5 Quick Ways to Speed up a Slow Drupal Site

Submitted by Brandon Cone on 01/29/2014 - 03:21:pm

Drupal is really good for a lot of things when it comes to websites. One thing that can sometimes get overlooked or can lag behind (if you don't hire the right team) is the speed of your site. With all of the modules being added and configured, some things are forgotten that help to fine tune speed and performance.

This situation is not uncommon for websites. If you're stuck with a slow site, and think you have to fork over more money to fix it, think again. Before you spend more money on additional server resources or hire a consultant, here are some tips and tricks you can do to help speed up your site. I've done my best to order these by complexity.

  • Drupal Performance - Drupal 7 comes with some pretty good tools for increasing the performance of your site.  Enabling these is always a good first step in increasing your site performance.  You can find these configuration options on the admin/configuration/development/performance page.
    • Page Caching for Anonymous users
    • Block Caching
    • Aggregate/Optimize Stylesheets and Scripts
  • CSS Emimage - This is a contributed Drupal module which helps speed the rendering of background images from your site's CSS files.  It's a plug-and-play module that you enable from the modules page and then activate from the performance page (mentioned above) - that's it.
  • Views Cache (If your site isn't views-heavy this won't help you much.) By default, views within Drupal aren't cached. Therefore, these pages (and blocks) are exempted from the cache settings you configured above. This is because views are intended to be dynamic aggregations of content and, therefore, by definition, excluded from cache. However, if you have a complex view, it might be good to have some cache settings on your view to help that page load more quickly.  NOTE: if you enable views caching, make sure you configure the expiration settings so that new content is shown on the view when rendered.
  • Apache Solr (for site searches) - Apache Solr is a site indexer which can vastly improve the speed of searches.  If your site doesn't utilize search, then this tip is not relevant.  Rather than having Drupal index your site and store the information in the database, Solr indexes and stores the information in a separate, dedicated search server.  When a search is performed, results are rendered directly from this index, so the database interactions are drastically reduced. 
  • Varnish - Varnish is an additional piece of software which you would need to install and configure on your server.  It serves as a "HTTP Accelerator" meaning that it is another cache which sits in front of your web server.  So when a request comes in for a page of your website, Varnish first checks for a cached version of that page.  If one exists, it is served directly from memory with no PHP functions or database queries required. (We have a handy tool that uses Varnish plus a little extra for better speed and performance)

Summary

These are some of the things we often check for our clients when a website is not performing as it needs to be. Using these handy tools will save time and money for your website administrator and site users.

I hope you found these tools helpful. If you did, pass them along to someone else who could use some help!

 

Photo by James Whitehead