JavaScript minification: an empirical study based on the July 1, 2011 HTTP Archive

Using the same methodology as in my earlier study of CSS minification, I tested 102,577 JavaScript URLs from the July 1, 2011 HTTP Archive release to determine how much the application of JavaScript minification could reduce their download size.

The 50th percentile benefit observed from applying minification to these JavaScript resources was:

  • 10.0% reduction in the uncompressed JS file size
  • 10.4% reduction in the compressed JS file size

The following graphs show the distribution of minification benefit:

Interestingly, the median size reduction that can be achieved by applying minification to the files in the July 1 HTTP Archive corpus is smaller for JavaScript (10.0% reduction before compression is applied) than for CSS (17.9%). This may indicate that websites in the Archive are more likely to have minified their scripts than their stylesheets.

Leave a Reply