Javascript Compression

Jan
09

I have been seeing a lot of AJAX-enabled Drupal sites that are not using JavaScript compression lately, and have been wondering how many people actually know how to use it. JavaScript compression has been around for a while, but the concept is still new for some people. The technology allows you to compress the size of JavaScript files in various ways to reduce download time, bandwidth and execution time on client browsers. While it is not always necessary if bandwidth or file size is not a big concern, large scripts can take much longer to execute unless they are compressed.

Here's an example of what I mean. We recently deployed a site with a media browser component built with jQuery. Uncompressed, the file size was about 80k, compressed, the file size was about 14k. Uncompressed, there was this massive delay in Firefox and Internet Explorer while the browser figured out how to deal with the script; about 10 seconds on some slower machines. Compressed, it executed immediately and there was no interruption after the page downloaded. Read More >>>