

Optimize Javascript Pages - missenlinx

I'm curious to know what everyone does to speed page load time when using fairly large frameworks like prototype or scriptacululous.<p>Now I understand the best solution would be to not use them but in my case this isn't an option.
======
nickb
1) Minify your JS: <http://www.crockford.com/javascript/jsmin.html>

2) Combine it into one file:
[http://www.thinkvitamin.com/features/webapps/serving-
javascr...](http://www.thinkvitamin.com/features/webapps/serving-javascript-
fast)

3) Gzip before delivering to clients

or...

use just Google JS API: [http://ajaxian.com/archives/announcing-ajax-
libraries-api-sp...](http://ajaxian.com/archives/announcing-ajax-libraries-
api-speed-up-your-ajax-apps-with-googles-infrastructure)

~~~
jbyers
... and _don't_ use one of the packing (NB: packing, not minifying) approaches
unless you measure and understand the performance impact on clients first.
Large packed JS can take hundreds of ms to unpack on slow clients.

------
Rik
A good option is to put the files at the end of the page. The page won't load
faster but the rendering will be done earlier. The user will see a faster
page.

Try to follow Yahoo! performance rules :
<http://developer.yahoo.com/performance/rules.html>

------
mnaganov
Do lazy loading. Although it doesn't speed up loading really, it helps to
create a smooth user experience.

------
STHayden
scriptacululous by default loads like 5 separate files. Only load the ones you
need!!

