News for hackers. Stuff that matters.

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.

( 5 comments | 5 points | on HN )
Re:Optimize Javascript Pages by nickb on Wednesday June 04, 2008 @11:33AM (#209008)
Re:Optimize Javascript Pages by jbyers on Wednesday June 04, 2008 @11:39AM (#209013)
... 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.
Re:Optimize Javascript Pages by Rik on Wednesday June 04, 2008 @12:20PM (#209062)
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

Re:Optimize Javascript Pages by mnaganov on Wednesday June 04, 2008 @03:40PM (#209295)
Do lazy loading. Although it doesn't speed up loading really, it helps to create a smooth user experience.
Re:Optimize Javascript Pages by STHayden on Wednesday June 04, 2008 @12:02PM (#209044)
scriptacululous by default loads like 5 separate files. Only load the ones you need!!