tags:

views:

42

answers:

1

Does anyone know of a tool that will tell me which JQuery functions are being used for a given page? I'd like to trim down the included files to just the bare minimum. Thanks.

+3  A: 

I don't think you'll want to go down this road, as it'll provide you very little if any benefit (and you may stab yourself in the eye trying to do it). Let me cover the 2 packages you mentioned in comments here separately.

jQuery Core is pretty small already, if you're using the minified version and serving it via gzip (and you should be doing this) then jquery is only 24kb (as of the current 1.4.2 release).

jQuery UI however is a bit heftier, you can strip down to the effects and widgets you need by using their download manager here, just select the components you need, leave the rest off, and get a minified/stripped down version that you want.


Part 2: Alternatives

Another alternative to give your users a better experience would be to include your scripts from a CDN, for example here are the links for Google's CDN:

You can also modify these a bit, depending how up-to-date you want to be, for example:

For reasons on why to use a CDN, take a look at this question.

Nick Craver
Thanks Nick! I've sped up the site considerably by following your recommendations. I'm getting 2 files from Google's CDN, combined a bunch of CSS into one file, and enabled compression and caching on the server. Also tracked down a few missing files. Main page was formerly 31 requests and 440K, I now have it down to 17 requests and 175k.
Cyrcle
@Cyrcle - Good work :) Also remember that client caching helps a lot, so all those static resources aren't normally fetched either...taking it down to 1 request + ajax stuff, check out [google's page speed addon for firebug](http://code.google.com/speed/page-speed/) if you haven't, very handy :)
Nick Craver