5 ms·
Optimize Javascript Pages
I'm curious to know what everyone does to speed page load time when using fairly large frameworks like prototype or scriptacululous.
Now I understand the best solution would be to not use them but in my case this isn't an option.
- nickb 18y ago1) Minify your JS: http://www.crockford.com/javascript/jsmin.html http://www.crockford.com/javascript/jsmin.html 2) Combine it into one file: http://www.thinkvitamin.com/features/webapps/serving-javascript-fast http://www.thinkvitamin.com/features/webapps/serving-javascr... 3) Gzip before delivering to clients or... use just Google JS API: http://ajaxian.com/archives/announcing-ajax-libraries-api-speed-up-your-ajax-apps-with-googles-infrastructure http://ajaxian.com/archives/announcing-ajax-libraries-api-sp...
- jbyers 18y ago... 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.
- STHayden 18y agoscriptacululous by default loads like 5 separate files. Only load the ones you need!!
- Rik 18y agoA 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 http://developer.yahoo.com/performance/rules.html
- mnaganov 18y agoDo lazy loading. Although it doesn't speed up loading really, it helps to create a smooth user experience.