1. 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

Discussion in 'Closed Suggestions' started by ankurs, Aug 11, 2010.

  1. ankurs

    ankurs Well-Known Member

    Alien and Michael Dance like this.
  2. Disjunto

    Disjunto Well-Known Member

    why would you do that?
  3. ankurs

    ankurs Well-Known Member

    will make pages load faster , read the yahoo link which i posted
  4. Shamil

    Shamil Well-Known Member

    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.
  5. Brandon_R

    Brandon_R Guest

    Michael Dance likes this.
  6. Shamil

    Shamil Well-Known Member

    That example was horrible, and plus, I couldn't see any elements using the script.
  7. Brandon_R

    Brandon_R Guest

    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?
  8. Shamil

    Shamil Well-Known Member

    I'd rather see the second, but this can be resolved using async load.
  9. Brandon_R

    Brandon_R Guest

    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
  10. Shamil

    Shamil Well-Known Member

    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.
  11. Floris

    Floris Guest

    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.
  12. Luke F

    Luke F Well-Known Member

    Was just about to suggest this myself - please consider it :)

    Even with the Javascript fully cached, it produces a noticeable speed increase.
    Michael Dance likes this.
  13. Forsaken

    Forsaken Well-Known Member

    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.
  14. Kier

    Kier XenForo Developer Staff Member

    My preliminary experiments with doing this have been unsuccessful to date, due to TinyMCE requirements.
  15. Mike

    Mike XenForo Developer Staff Member

    Actually, the TinyMCE init code has recently changed, so it we may be able to revisit it.
  16. Princeton

    Princeton Well-Known Member

    this is good news - a millisecond/second here and there all adds up to a FASTER xenforo
  17. David Thomas

    David Thomas Active Member

    Especially once you start getting tons of traffic/views, then those seconds can REALLY add up!
  18. ankurs

    ankurs Well-Known Member

    mike, any update on this ?

    or do it partially by keeping timymce js in header and move rest .js to footer
  19. AlexandrosD

    AlexandrosD Active Member

    I can only ask for a seperate template for each javascript, css file
  20. ankurs

    ankurs Well-Known Member

    Is this still being worked on ?

Share This Page