Front-end tuning: downloading javascript files in paralell
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
| Attachment | Size |
|---|---|
| externaljs1.png | 75.51 KB |
| waterfall1.png | 6.58 KB |
| waterfall2.png | 5.92 KB |


see http://api.drupal.org/api
see
http://api.drupal.org/api/function/drupal_add_js/6
for scope set it to 'footer'
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
East Asia Office
Hong Kong
That will help, I will post
That will help, I will post something when it's done.
Thanks
God bless Drupal
You can also do a quick edit
You can also do a quick edit in your page.tpl.php file and move
<?phpprint $scripts;
?>
I was not really clear on my
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
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
Another module that might help http://drupal.org/project/css_gzip