Monday, January 25, 2016

Drupal performance improvement (valid for version 7)


Drupal version 7, objective is to improve both Desktop and mobile versions of your website, improve SEO ratings like page loading speed, text to HTML ratio, number of CSS files, Javascript footprint size, overall page footprint size, number of files to load.

Improvement process

Drupal is module based CMS, so you are going to need only a couple of modules added to your installation. Each module and its use follows. Hopefully this article will be updated quite a few times.

PHP filter + Browscap

There are a couple of Drupal modules that allow hiding content based on device size (mobile or desktop). Tried quite a few Mobility modules, but none of them seem to work, where old or required modules like Cache to be turned off. And its not what I wanted.

In mobile versions I sometimes disable large slideshow blocks or page images, if you are up for that, here is what you do: download browscap, deploy it and enable both modules (PHP filter is native Drupal module). Open you block, enable PHP condition and paste this snippet:

$mobile_agent = browscap_get_browser() ;
if($mobile_agent['ismobiledevice'] == "false"){return true;} 


This module simply removes all the unnecessary characters from your HTML and Javascript files. Compresses and creates copies of all you Javascript includes. This makes your files download faster. Some of the files are not being compressed due to their already small footprint, pay no attention to them. I will not describe how to use this module, its self explanatory. Once deployed you will find it under cache/performance management. Link for download. Suggesting enabling it when production ready since output HTML and JS files are hardly human readable.


Full module name is Advanced CSS/JS Aggregation. This module combines (even cached) css files into a single file, which gives quite a few performance points in some of SEO evaluation tools. Combining your CSS files also reduces text/html ratio. Setup has quite a few tabs, but just follow the setup and enable CSS compression.


Usage of all these modules above may improve your website SEO evaluation by up to 10%. If not, then they will at least improve your page loading speed and overall performance compared to your competitors. Any feedback to this article is highly appreciated.

No comments: