MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - JS files are coming top in waterfall instead of coming at the end

WebPagetest Forums

Full Version: JS files are coming top in waterfall instead of coming at the end
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you see the waterfall, it showing the JS files are loading at line 14 and 15. But if you open and see the view source of the page, javascript files are included at the end in page source.

Is there a bug in webpage test ?

http://www.webpagetest.org/result/130606...1/details/

JS : http://ir.ebaystatic.com/z/qb/yvhv3fhwwu...suvbuhy.js

if you see in chrome network panel you can see that JS files are coming as expected the end.
It's a feature of the way the Chrome prioritises the download of resources, Firefox does something similar but it's more subtle.
if its happening because of the chrome optimization, why i am not seeing it in my local latest chrome browser?
You should be able to see it in the local browser too, I can...

If you test channel4.com, the difference in waterfalls is reasonably noticable when highlighted - https://twitter.com/andydavies/status/34...28/photo/1

Channel4.com, Chrome - http://www.webpagetest.org/result/130608...1/details/

Channel4.com, IE9 - http://www.webpagetest.org/result/130608...1/details/
Interesting! To avoid the blocking we move scripts to the bottom of the page. now chrome is making high priority and loading them on top. Wondering if there is any documentation (from chrome or any blog posts) to understand when and why chrome does it and how doe it improves the performance.
(06-12-2013 12:58 AM)kbprakash@gmail.com Wrote: [ -> ]Interesting! To avoid the blocking we move scripts to the bottom of the page. now chrome is making high priority and loading them on top. Wondering if there is any documentation (from chrome or any blog posts) to understand when and why chrome does it and how doe it improves the performance.

There is but I can't find it right now - this is the closest I get http://www.igvita.com/slides/2012/web-pe...urious/#25

Remember it's the preload scanner doing this i.e. it's looking for the blocking resources and scheduling their download so they get downloaded sooner.

Even though the preloader is scheduling the download of scripts early, if they were higher in the document they would still block rendering until they've been downloaded and executed so by placing them at the bottom they don't block rendering.
Here is the write-up from the changes that were made to the scheduler in Chrome 27: https://docs.google.com/document/d/1JQZX...&forcehl=1

I wouldn't change anything on the page because of it though, the scheduler is an evolving work in progress and hopefully it will get smarter about balancing priorities across images and scripts based on where they are on the page.
Reference URL's