• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest [Suggestion] Move .JS

Shamil

Well-known member
#4
Not all scripts produce these issue, Google Analytics uses asynchronous loading. I believe async can be implemented. Whilst it'll make the page load faster, some components of the page will not work until the JS has finished loading.
 
#7
The examples shows the point.

JS on top - nothing after the javascript can load without first loading the javascript
JS on bottom - the entire html of the page loads so the user can start looking at content then when the js loads then can the javascript features be used.

That page is designed to take 10 seconds to load.

JS on top - 8 seconds for js then the other 2 for content
JS on bottom - 2 secs for content first then 8 seconds for JS

Which would you rather see first?
 

Shamil

Well-known member
#8
The examples shows the point.

JS on top - nothing after the javascript can load without first loading the javascript
JS on bottom - the entire html of the page loads so the user can start looking at content then when the js loads then can the javascript features be used.

That page is designed to take 10 seconds to load.

JS on top - 8 seconds for js then the other 2 for content
JS on bottom - 2 secs for content first then 8 seconds for JS

Which would you rather see first?
I'd rather see the second, but this can be resolved using async load.
http://www.artzstudio.com/2008/07/beating-blocking-javascript-asynchronous-js/
 
#9
There are many ways to load javascript without blocking the contents of the page. Here are some from a book i bought "High Performance Websites". I'm guessing async load is equal to the first one "XHR Eval" since it's loading javascript via ajax.

• XHR Eval
• XHR Injection
• Script in Iframe
• Script DOM Element
• Script Defer
• document.write Script Tag
 

Shamil

Well-known member
#10
There are many ways to load javascript without blocking the contents of the page. Here are some from a book i bought "High Performance Websites". I'm guessing async load is equal to the first one "XHR Eval" since it's loading javascript via ajax.

• XHR Eval
• XHR Injection
• Script in Iframe
• Script DOM Element
• Script Defer
• document.write Script Tag
Yep, and I seem to have a moderate issue. Load up the following page in Firebug: http://www.radonsystems.net/home and see the net tab. You'll see what I mean.
 
F

Floris

Guest
#11
UI preload methods should simply go to the top, libraries can be at the top, but preferred to be on a cdn.
And everything that's asynchronous can be at the top. everything that compliments the page and can be called post-loading the layout, and isn't asyn. should in my opinion be thrown at the bottom.

Load the page in timeline on Safari, and you will see there's currently no issue with the way things are loaded.
 

Forsaken

Well-known member
#13
Was just about to suggest this myself - please consider it :)

Even with the Javascript fully cached, it produces a noticeable speed increase.
It already has CDN capabilities; they're using local to save time during the alpha.

EDIT: I mean for js, not for other things, so theres no misunderstanding with my post.
 

Kier

XenForo Developer
Staff member
#14
My preliminary experiments with doing this have been unsuccessful to date, due to TinyMCE requirements.