I am hosting a website on a Windows server, and I would like to use the JQuery library for some general functionality and effects. However, the uncompressed version of the file is approx 77kb, which seems a bit much, or is that acceptable?
There are a number of versions available from the site
http://jquery.com/Minified -
http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js 45.3 KB
Packed -
http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.pack.js 26.5KB
Uncompressed -
http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.js 78.6 KB
However, from the homepage itself it mentions a version being minified and gzipped as being 14KB, but there's no download link there, only to the minified version which has a 45Kb filesize.
I don't have any experience or knowledge about the differences between gzip, packed, minified etc. What is the best method for including the JQuery library into the site? I was under the impression that gzip was for Unix servers only, is that correct? I have a separate Unix box which I could host the file on, but how would I reference it in the header, and would there be any problems with ssl and differing domain names. i.e. assuming the main site is called
www.windows.com and the file is hosted at
https://unix.windows.com/jquery.js ?
My initial thought is to go with the packed version at 26kb, but someone advised against it on one of the blogs related to the jquery site. Here is what they said:
"using PackerÂs redundancy reduction algorithm adds a delay at the time the script gets executed (because the script needs to be unpacked and then evaled) On my laptop, this delay is about 200 msec. The conclusion is clear: for optimal performance, gzip your JavaScript code, and stay away from advanced JavaScript compression schemes that look attractive on paper, but end up degrading the performance of your site."
And another comment:
"GZip is absolutely the correct way to compress javascript.
No eval-based compression scheme should be used because it simply takes too long to decompress the javascript file in the browser.
DonÂt believe me? Consider the savings. If you save 40 kB by compression from 60 kB to 20 kB, it only takes 40 ms longer to download the full file the first time using a 8M ADSL connection.
Afterwards, you pay for the compression every time when the page is being reloaded. If it only takes 10 ms to decompress (and my measurements indicate that for my hardware itÂs more like 20 ms), then after 8 page refreshes the advantage is gone.
So say yes to minimification schemes that make it possible to cache and reuse the javascript file without a decompression step.
Size isnÂt everything."
http://www.julienlecomte.net/blog/2007/08/13/Based on such information, what would be your advise, go ahead with the packed version at 26kb and disregard the execution time each time a page loads, or simply use the uncompressed version at over 77kb? The site I am working on is targeted at the UK audience, and from what I understand, most people are on atleast 2mb broadband here.
Start Free Trial