开发者

Why is jQuery so big when I download it? [closed]

Closed. This question is off-topic. It is not currently accepting answers. 开发者_运维问答

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I went to jquery.com and downloaded the latest version. I picked the production:

31kb (minified and zipped)

but when it downloads to my disk it's 90KB. Can someone explain. Am I downloading the wrong way or something?


The size specified is how large it will be if you are using compression for your static files on the web server.

What you download is the minified version. It's not zipped, because the web server will do that before sending it to the browser.


It says Gzipped, not Zipped.

31kb refers to the amount of data you have to download, when taking minification and the webserver's Gzip compression into account.

When the file arrives at your PC, it is de-Gzipped for use. However, it's still minified, so it's around 90kb rather than 200-odd kb.

Have a read through this.

Summary The number on the website indicates the download size, not the file size.


The word "minified" means that comments where removed etc etc that leads to a size of 90kb The word "zipped" means that if the server serve jquery gzipped you get a size of "31kb"

I always use this: https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js. The chances are high that the visitor already have jquery in cache.


This really isn't suited to be a SO question. I mean, all it takes is simple reading - it says "minified AND zipped". When you download it it is not zipped if you want to see the plain text version, is it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜