While the Drupal content management system (CMS) is great at getting your site up and online in an easy-to-use manner, the default installation comes with quite a bit of bloat. Because users tend to be impatient, you should take care to optimize your site to minimize the page load times seen by your users. This article covers several techniques you can implement to improve the performance of your Drupal site. We will first cover the fixes you can make by changing your site’s configuration settings. Then, we will cover improvements resulting from use of Drupal’s modules.
Using the Latest Version of Drupal
If at all possible, you should run the latest version of Drupal, as well as contributed modules and themes. New releases contain bug fixes and performance improvements, and you can take advantage of these things by keeping your core, contributed modules, and themes up to date. You can check to see what, if anything, needs to be updated by navigating to Reports → Available Updates while you’re in the Manage Dashboard.
Configuring Your Site for Optimal Performance
Drupal has several built-in settings that can help improve your site’s performance. To see these settings, navigate to Manage → Configuration → Performance. On this page, you can enable or disable specific functions included in the Drupal Core installation. These are some of the most basic things you can do to improve your site’s performance.
Every time a user loads your page, the web browser sends a request and your servers, including your database, respond by providing the required files to render your page. This results in the execution of a bunch of database queries, each of which takes time. However, for static pages that do not change between users, Drupal’s Internal Page Cache can cache the rendered contents (which is HTML content) and store it in a separate database cache so that it can be recalled quickly for different users. For example, if you have multiple users visiting your site from different computers, Drupal first looks at the database cache table to see if the page is there, and if it is, Drupal will serve the page from the cache instead of calling the database. Essentially, setting this feature reduces multiple database queries into a single query that will serve multiple users.
To use this feature, set the value for page cache maximum age. You can choose to cache for a minimum of 1 minute to a maximum of 1 day. Try to cache for as long as possible to gain the most benefit performance-wise for your site.
Drupal’s built-in caching feature only works for users that are anonymous to your site (and therefore not logged in or otherwise identifiable). For identifiable users, you can choose to enable special page areas that are known as blocks. Blocks show up as customized content (such as user profiles, dynamic location data, or pages that have user-specific settings), and this data is not appropriate for display to all users. If your site utilizes these features, you will need to use the Dynamic Page Cache feature, which caches all static content and works for all users, regardless of whether they’re anonymous or not.
Under this section, you can enable one or both of the following options:
- Aggregate CSS files
Disable Unused Modules
Configure Cron Job
By default, Drupal’s “automated cron” system is set to run every three hours to check for updates, indexing content, and clearing temporary files.
While the Cron job is great for cleaning up your site, so to speak, running it requires resources (in terms of server processing power and memory), so visitors to your site while Cron is running will see slower page load times. As such, you may want to increase the amount of time between Cron jobs.
Installing and Using Performance-Related Modules
You can use modules to extend and customize the functionality of your site, as well as integrate with third-party services. The default Drupal installation comes with several useful modules, but there are many others you can install if the included ones do not meet your needs. These additional modules are called contributed modules, and you can read more about installing modules at SiteGround.
Integrate Your Drupal Site with a Content Delivery Network (CDN)
By integrating your Drupal site with a CDN, you can deliver content to your users using the server(s) closest to them. Minimizing the distance between the users and the server hosting the data will reduce the amount of time the users spend waiting for a site to load, as well as take advantage built-in features such as resource optimization. As such, you should consider using a CDN to serve as many of your resources as possible. While caching reduces the number of HTTP calls required, using a CDN minimizes the overhead required in the event that an HTTP call is made. In addition, your CDN might offer up content in its most optimal form and offer built-in scalability features, which is helpful for unexpected surges in traffic.
Optimize Your Images
Images, while an extremely important part of your site, are expensive assets, and you should take care to optimize these to the best of your ability. The following modules can help minimize the overhead generated by using images on your site.
Use Image Sprites: You can create image sprites to send multiple background images within the same HTTP request. Two modules that you can use to generate sprites are CSS Sprite Generator and Spritesheets.
Lazy-Load Images: By lazy loading images, your site only delivers the images that are above-the-fold. Only when the user scrolls down are additional images requested and rendered, which results in a faster page load and fewer resources used. Some modules that can add this feature to your Drupal site are Image Lazyloader or Lazyload. For lazy loading images on Drupal’s views, you can use Views Lazy Load.
Use Image Optimization: Drupal’s core Image Toolkit module can change the quality of your images, but you can garner additional image size savings.
By utilizing the ImageAPI Optimize module to losslessly optimize your images whenever you save your images and the Image Resize Filter to ensure that the images you upload aren’t too big, you can speed up the loading of your page.
Optimize Your Database
One easy way to optimize your Drupal database is to use the OptimizeDB module. Once you have installed and activated the module, you can select some or all of your database tables to optimize. This process includes clearing out selected tables (such as caches), rebuilding or repairing tables, sorts indexes, and updates table statistics. Using this module allows you to perform basic optimization and cleanup of your database tables without requiring you to learn query languages and be familiar with your database’s structure.
Drupal’s out-of-the-box configuration comes with quite a bit of bloat, which leads to slower page load times for your users. You can easily improve your site’s performance by changing just a few of your site’s configuration settings and installing Drupal modules that extend your site’s abilities, and these techniques are easy to implement for many users.
If, however, you think there are additional improvements to be made to your site, please contact Rigor for a free performance report that contains additional personalized information on what you can do to ensure that your site is running as fast possible.
E-commerce revenue continues to grow,as consumers turn away from shopping in brick-and-mortar stores to shopping online. However, many businesses are not prepared for this growth because they do not fully understand the market and how to invest in...Read More
Because of the multifarious nature of web clients today, it’s important to consider the usage statistics when designing, implementing, and managing your site. However, misconceptions often arise when determining what browsers to design...Read More
Google Webmaster Tools is a web service that allows webmasters to view the status of their sites as seen by Google and the Googlebot crawlers. In addition to indexing your site structure and content, the Googlebot crawlers also record data on perform...Read More
Web designers and developers are always looking for ways to speed up their page load times. Yahoo has an excellent article written on the best practices for speeding up your page. How do you know if implementing one of their suggested practices will...Read More