We need to follow some tips to speed up Drupal and keep it running faster.
We should always run the latest version of Drupal as updates generally contain bug fixes and performance improvements and always keep the core modules and themes updated.
To check updates,
- Go to “Reports” → “Available Updates.”
- You can then click on “Check manually” to scan for additional updates.
2.Content Delivery Network
Drupal has some caching options. This is probably the easiest way to speed up Drupal performance on our site. By default this is turned off.
- Go to “Configuration” → “Development” → “Performance”
- Enable “Caching.” You can then choose page cache maximum age.
- Click on “Save configuration.”
The views module is probably one of the most popular modules on Drupal. If you have it installed you can also enable caching on it.
- Go to “Administration” → “Structure” → “Views.”
- Click “Edit” on the view you want to enable caching on.
- Expand the “Advanced box.”
- Select “Time-based” and click on “Apply (all displays).”
- Select the time you desire and click on “Apply.”
Optimizing images can decrease your page load times . We can change the compression ratio on JPEGs. By default in Drupal 8 it is set to 75%.
- Go to “Configuration” → “Image toolkit.”
- You can then change the % amount .
- click on “Save configuration.”
There are also Drupal image optimization modules available such as “
Image Optimize” and ‘
4.Lazy Load Images
Lazy loading images can increase your page load times. The most popular Drupal 8 module for this is the ”Image Lazyloader”.I also recommend using a module like “Image Resize Filter” so that our images are scaled down when we upload them and we aren’t relying on CSS to scale them down.
Instead of using a module to check for 404s,run your website through an external service such as the “Online Broken Link Checker”or a tool like “Screaming Frog”.This ensures that you aren’t wasting any of our server’s resources on this task.
Also Drupal has expensive 404 errors.On an average site with an average module load,we can see that 60-100MB of memory being consumed on your server to deliver a 404.The Drupal ‘Fast 404’ module fixes this and usually can deliver 404 errors using less than 1MB of memory.
6.Enable CSS/JS Aggregation
7.Reverse Proxy Server
We can place another application in front of ours that will serve cached copies of our Web pages. This is called “reverse proxy caching” or an “HTTP accelerator”. Varnish is used for high-traffic websites like Wikipedia, Facebook, Twitter, etc. Varnish is one popular Drupal 8 module used for this.
8.Choose Fast Web Hosting
Choosing a reliable and fast web host is another most important decisions you will make when trying to improve Drupal performance.Stay away from cheap shared hosting as they tend to overcrowd their servers and we will end up sharing resources between hundreds of people. I suggest going with a VPS like Digital Ocean, Linode, or Vultr.This will give you complete control of your resources.
We can use drupal 8 BigPipe module to speed up site.Drupal 8’s BigPipe module uses a technique called “auto-placeholdering” which essentially auto-detects and divides static webpage content and elements from dynamic site content and elements (unlike traditional webpages whereby front and backend pages are connected).
10.Indexing Large Mysql Tables
Indexing is an important feature of MySQL. It supports different type of indexes like primary key index, unique index, normal index and full-text index. Indexes help to speed up the retrieval of data from MySQL database server. When retrieving the data from a database table, MySQL first checks whether the index of table exists. If yes it will use index to select exact physical corresponding rows without scanning the whole table.Indexes make search queries much faster.Indexes like primary key index and unique index help to avoid duplicate row data.
Syntax for indexing,
CREATE INDEX index_name ON table_name (column1, column2, …);
11.Uninstalling Unnecessary Modules
And last but not the least,you can speed up Drupal 8 by removing all the modules that aren’t being used. Every module will add a performance hit to your site.There are many Drupal sites with hundreds of installed modules, many of which aren’t actively being used.So uninstall all modules which are not used.
While there are many factors that can determine the overall speed of a Drupal site, you just have to know where to look. From implementing a CDN to caching, image optimization, lazy loading images, fixing 404s, aggregating CSS/JS Files, and disabling unnecessary modules.