Introducting the Speedy Module

Website front end performance is important. Better than 85% of the time it takes for a page to load occurs in the front end. One of the low barrier to entry ways to speed up a site is to make sure the JavaScript sent to browsers is minified. This is considered a standard practice with other common platforms, like Sharepoint and Wordpress, already doing this. The Speedy Module brings minified JavaScript files to Drupal core.

What Do Minified Files Give Us?

An example can help us see where the gains are. A minified version of drupal.js is 24% the size of the original. That means you have 76% less to send to users.

This happens because a minified JavaScript has most comments remove, whitespace removed, and can even transform functions to make them smaller. One of the simplest function alterations is to rename safe variables to single letter names.

What About GZip Compression?

I've been told that minified files aren't necessary if you use gzip compression. This isn't really the case. When you compress with gzip (or Deflate) everything is compressed. That includes the comments in the code and the spaces used for indentation. Then in the browser (even mobile browser) all if this is ungzipped. Minified JavaScript should be used along with gzip compression to get the best of both worlds.

How The Speedy Module Works

Some of the JavaScript libraries used in Drupal core are already minified. But, most of the common Drupal specific JavaScript is not minified. The Speed module contains minified versions of these core files and swaps out the core one for the minified version. This files are handled per Drupal version so alterations to core JavaScript are taken into account.

If you want a simple way to speed up your websites consider installing Speedy.