8 best practices for optimizing a Drupal site

8 best practices for optimizing a Drupal site

First launched in 2001, Drupal is a free and open source CMS written in PHP and distributed under the GNU (General Public License). Drupal is used as a website builder by at least 5.1% of all websites worldwide, which places it in 3rd place behind WordPress and Joomla. Renowned for its robustness, Drupal powers all kinds of sites, from personal blogs to corporate, political and government sites. In this article, we will give you some tips to optimize the performance of your Drupal site .

OPTIMIZING A DRUPAL SITE WITH CACHING

Caching is a mechanism for temporarily storing web pages to reduce bandwidth and improve performance. When a visitor arrives at your site, the cached version will be served unless it has changed since the last cached. Drupal has a number of caching features that are worth using: page caching, view caching, and block caching.

OPTIMIZE ALL THE IMAGES ON YOUR DRUPAL SITE

You can and should use this trick on all of your websites, not just those powered by Drupal. The use of images is important in order to illustrate your content. For example, did you know that blogs get 94% more views if there are images in a post? Be careful though, as these images are a double-edged sword. While they can help engage audiences, they can also hurt Drupal’s performance. The easiest way to optimize images is to give them the correct size before uploading them to your site. Don’t use huge graphics or high-quality photos. Just try to adapt the size and weight of your images using code or third-party sites.

CONTENT DELIVERY NETWORK (CDN)

A frequent recommendation for improving the performance of a website, whether it’s Drupal or any other CMS, is to use a content delivery network (CDN). A CDN is described as “an interconnected system of cache servers that use geographic proximity as the criteria for delivering web content.” In other words, a CDN provides a way to take a website’s static files, like CSS, images, and JavaScript and deliver them through web servers closer to the user’s physical location. Shorter proximity equals faster loading time. Some examples of CDNs are AWS Cloudfront, Fastly, or Cloudflare.

CLEANING UNUSED MODULES

One of the best practices is to check the modules that you really need. Then deactivate the ones you are not using. By keeping all the modules, you will clutter the site with each load. This will have an impact on the loading times. When dealing with the question of modules, the best approach is to properly measure your needs. What are your modules actually doing? Are they really adding value to your site? If some of them are rarely used, you can turn them off without regret. There may be another method to achieve the same result without impacting performance.

OPTIMIZING A DRUPAL SITE BY UPDATING PHP

PHP is the backbone of many content management systems like Drupal. Each version has the potential to improve your site’s performance. So you have to make sure that your website is using the most recent stable version of PHP. It will also improve the user experience. Many hosting providers allow users to change PHP version from systems like cPanel. In a drop-down window, you can select the version to use and activate it. However, you need to be careful when changing the version of your software. Some modules or scripts may not support some versions of PHP. So remember to save your site and all the files before “touching” PHP.

ADOPT CLOUD-BASED WEBSITE MONITORING

Offloading the monitoring of your website to a cloud-based host has significant benefits: cost, scalability, efficiency, to name a few. Not to mention, it allows you to focus on growing your business, which matters most. With this type of service, you can know when your hosting service goes down. You will also receive notifications (call, SMS, emails or even Twitter) as soon as something happens.

HOW TO HANDLE 404 ERRORS

Instead of using a module to check for 404 errors, we recommend that you occasionally check your website through an external service such as the “Online Broken Link Checker” or a tool like Screaming Frog. This ensures that you are not wasting any of your server resources on this task. Drupal also has expensive 404 errors. On a medium-sized site you can consider that 60-100MB of memory is consumed on your server to provide a 404 error. The Drupal Fast 404 module corrects this and can generally provide 404 errors using less than 1MB of memory.

OPTIMIZING A DRUPAL SITE: UNDERSTANDING THE EXPIRES HEADER

The Expires header (or HTTP header) is a powerful caching management tool. It can be used to define the content cache policy. So it has the potential to make website caching more efficient. Many tools trigger a warning if you don’t have an “expires” header in the .htaccess file. By configuring your headers well, you will allow the caching of a maximum of elements among those that change rarely (background elements, icons, logos …) Thus, the user will load much less data when his next visits.

Leave a Comment

Your email address will not be published. Required fields are marked *