Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get 19KB Minified version of jquery file?

Jquery.com shows Minified and Gzipped version as 19KB?

Production (19KB, Minified and Gzipped)   
Development (120KB, Uncompressed Code) 

but when we click on download for Production version. it goes to this link

http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&downloadBtn=

and the file which is on this page it's size is 55.9 KB. Why jquery.com showing Production (19KB, Minified and Gzipped)

like image 773
Jitendra Vyas Avatar asked Dec 23 '09 16:12

Jitendra Vyas


2 Answers

The file's unzipped size is 55.9 kB. That is the result of the minification, which is a shortening of variable names, stripping of white space and the likes.

When you gzip it additionally, it will lose even more size. The gzipped file is downloaded by the browser and unzipped into the 55.9 kB large, minified version internally so it can be read by the JS interpreter.

You can zip files using gzip but usually, if the server is set up correctly, the server will automatically serve gzipped files if the browser signals it can handle them. In that case you don't have to do anything. You can see whether a file was transmitted gzipped using the "view size information" tab in the Web Developer Toolbar for Firefox.

like image 149
Pekka Avatar answered Sep 20 '22 17:09

Pekka


How to get 19KB Minified version of jquery file?

% wget http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js

% gzip jquery-1.3.2.min.js

% du -b jquery-1.3.2.min.js.gz

19716   jquery-1.3.2.min.js.gz
like image 22
YOU Avatar answered Sep 17 '22 17:09

YOU