[wp-hackers] Re: Packing JavaScript

Charles lists07 at wiltgen.net
Wed Sep 19 18:52:26 GMT 2007

> 2. Javascript compression.
> - Can be made "safe" at the cost of making better optimizations.

It can be made completely safe without any optimization cost as long as you
also use GZIP (see below).

> - Only provides a ~50% improvement.
> - Provides less than a 3% improvement if done in combination with
> GZIP like compression.

Here's a RealLife(tm) example that may make you reconsider:

    File                                File size      GZIPd file size

    Original jQuery library             62,885 bytes   19,758 bytes
    jQuery minified w/ JSMin            36,391 bytes   11,541 bytes
    jQuery minified w/ Packer           21,557 bytes   11,119 bytes
    jQuery minified w/ YUI Compressor   31,822 bytes   10,818 bytes

So with the YUI Compressor (my recommendation) example, JavaScript
compression provides a ~50% improvement (as you say), but GZIPing that
provides /another/ ~50% improvement over GZIPing alone.

-- Charles

More information about the wp-hackers mailing list