Front-end tuning: downloading javascript files in paralell

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
redox's picture

I was looking for frontend tuning for faster page load. I found some very good technics, almost all already improved by drupal, but I can't figure out how to load javascripts in the button of the page. As you can see Javascript is loaded on the top of each page, while that happens page loading is blocked to other things like loading images,flash and also cause a gap while processing that code and restart loading the rest of the page...

I think these urls are good guides for improving front-end performance:
http://code.google.com/intl/en/speed/page-speed/docs/rules_intro.html
http://sites.google.com/site/io/even-faster-web-sites

Is there someone that know how to load drupal javascripts in the button?

thanks

AttachmentSize
externaljs1.png75.51 KB
waterfall1.png6.58 KB
waterfall2.png5.92 KB

Comments

see http://api.drupal.org/api

dalin's picture

see
http://api.drupal.org/api/function/drupal_add_js/6

for scope set it to 'footer'

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

That will help, I will post

redox's picture

That will help, I will post something when it's done.

Thanks

God bless Drupal

You can also do a quick edit

Jamie Holly's picture

You can also do a quick edit in your page.tpl.php file and move

<?php
print $scripts;
?>
to the bottom the page.

HollyIT - Grab the Netbeans Drupal Development Tool at GitHub.

I was not really clear on my

redox's picture

I was not really clear on my post, but it's not only about putting scripts on the button, it's about change the way drupal call it or change the javascript tag. A simple change could be adding a defer="defer" on javascript tag. It could solve that for IEs and new FF3.5, but only putting the scripts on the button not really avoid javacript blocking page load.

Thanks

God bless Drupal

Parallel Module

mikeytown2's picture

http://drupal.org/project/parallel
It splits images css and js into their own domains. if using javascript optimization, then this won't do much since it only downloads 1 file... I made a post that has some ideas for lazing loading: http://drupal.org/node/543510

CSS Gzip

Francewhoa's picture

Another module that might help http://drupal.org/project/css_gzip