I like doing things at my own pace but when it comes to website performance, I need it to be super-speedy. Speed thrills and low speed definitely kills. Now that you’ve just set-up your Drupal website and it looks great, why bother about your website’s performance, you ask? A speedy performing website will improve your SEO ranking, engage your customers better, help you increase conversion rate, thereby boosting your sales and revenues.
With Drupal, you can build extremely powerful and well-performing web applications. Below are a few tips for you to optimize the performance of your Drupal website.
To extract the best performance out of your Drupal website you need to configure caching. You can easily cache your website with Drupal’s various in-built caching options. The simplest approach is Page Caching which you will have to enable in the Performance section. You can cache blocks and pages and can also set your cache expiration time here. Caching can be done on individual Drupal modules like Views and Panels. For better performing cache, you can choose from some external modules that integrate seamlessly into your website like:
- Memcache: With Memcache installed you can reduce your database load as it can cache your database objects in RAM. So your database queries will return faster results as it doesn’t always have to go right till your database.
- Boost: If your traffic is mostly anonymous and if you’re using shared hosting, this module provides a significant boost to your site’s performance. It provides static page caching for your Drupal website.
- Varnish: This can provide a very high performance to your website if your site is largely static. It sits in between a user and your web server. It stores your page’s data in a cache and whenever a page is requested, it looks into its cache and provides the user with a cached version of your page.
CDN (Content Delivery Network)
CDNs are a network of edge servers that are placed worldwide which can basically contain cached versions of your images, videos, JS and CSS files (and sometimes even entire pages). Since the travel time to get to this data is less, your page loads much faster and the load on your web server is reduced thus improving scalability.
Disable un-used Blocks and Modules
If you have any modules or blocks that are not being used, it is recommended to disable them as they can simply make your Drupal website heavier and use up resources unnecessarily.
Optimize your themes
By manually removing blankspaces, comments, indentation and all unnecessary codes from the theme files (.tpl) , your Drupal website can have faster load times. In the Performance page you can also turn on JS and CSS aggregation for better front-end performance.
Optimize your Images
A good looking website will contain a lot of good looking images but they come with a price and makes your website heavy and thus sluggish to load. You can directly compress your images in Drupal by setting the compression ratio on your Jpeg files. By clicking on ‘Configuration’ -> ‘Image Toolkit’, you can set the % of compression. Additionally there are other modules you can use to optimize your images.
A few bonus tips:
- Practice best coding standards when writing your code and eliminate any un-used code.
- Go with the best and fastest hosting provider available for Drupal websites.
- Use client-side validations.
- Keep a check on your database load times and optimize it using the DB maintenance module.