GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes JQuery Versions need help choosing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JQuery Versions need help choosing" Watch "JQuery Versions need help choosing" New topic
Author

JQuery Versions need help choosing

Michael Hubele
Ranch Hand

Joined: Dec 17, 2005
Posts: 182
Hi

I am new to Jquery and I need some help choosing which version is the best version too take.

They got 3 Versions

1. Minified
2. Uncompressed
3. Packed

It say's on there site that Uncompressed is best for testing and learning. I am wondering why is this so? Is it because it can be opened up and has full comments?

I also heard that if you use Minified and gzip it that is the best since you get some crazy compression what I am guessing is alot better because the people who come to your site can download it alot faster compared to the uncompressed.

I don't know if it is that big of deal these day's since everyone is starting to get alot faster internet connections. However I rather use the smaller package if there is basic no downside to it(ie does everything the uncompressed one does).

I am wondering do alot of people use the uncompressed one in their production environment and then download the minified one and gzip it when its time to launch?

Also is there an alternative to gzip? Because I don't think I can use gzip since my site will hosted on a windows machine(using asp.net with c#). I also heard that the packed version is not really that good. It maybe smaller but takes more time to unpack it and stuff.

So are there any other ways I can get by this with the smallest size possible and no cost of performance or anything else?

Also one more question with the gzip one. How does that work anyways? like do you just put the gzip file location in the the script tags up in the header and it knows what to do? or do you got to do something special for it to work?

Thanks
[ June 08, 2008: Message edited by: Michael Hubele ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

The uncoompressed one is good for learning because you can look at the code, as you stated. Other than that its just size. Size does matter. And oddly enough, the smaller the better. That's really about all there is to this. Smaller size equals faster load although most browsers cache scripts anyway so even then, considering the uncompressed version is only 97kb, it really doesn't matter.


GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

The jQuery team recommends using the minified version for production environments. The packed version is smaller, but needs run-time processing to unpack.

Even though the clear-code version isn't all that big (as these things go), it's quite common to use more than a few plugins with the core jQuery library. (In a recent project I ended up including 14 jQuery-related script files).

At that scale, minified versions make a significant dent in the download footprint.
[ June 08, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

With regards to gzipping, it's not a simple matter of your zipping up the file yourself. The appropriate response headers need to be set in order to let the browser know that the response body needs to be unzipped. So either your web server needs to be set up to do the zipping, or you need to write your own server-side code to intercept the request for the file and serve the gzipped version while setting the appropriate response headers.
[ June 08, 2008: Message edited by: Bear Bibeault ]
Michael Hubele
Ranch Hand

Joined: Dec 17, 2005
Posts: 182
So I should just go with the minified version then?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

You should go with what you feel serves your purposes best. For me, the jQuery team's recommendation of using the minified versions works best.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You might be interested in this: http://googleajaxsearchapi.blogspot.com/2008/05/speed-up-access-to-your-favorite.html

Eric
Michael Hubele
Ranch Hand

Joined: Dec 17, 2005
Posts: 182
Originally posted by Eric Pascarello:
You might be interested in this: http://googleajaxsearchapi.blogspot.com/2008/05/speed-up-access-to-your-favorite.html

Eric


Cool I will look into that in more detail when I am ready to launch my site.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Originally posted by Michael Hubele:
Cool I will look into that in more detail when I am ready to launch my site.

I wish they'd also host the plugins. I know of no jQuery user that doesn't use at least the Form plugin,
 
GeeCON Prague 2014
 
subject: JQuery Versions need help choosing