Uploaded image for project: 'JIRA Server (including JIRA Core)'
  1. JIRA Server (including JIRA Core)
  2. JRASERVER-13459

Significantly improve perceptual page load times by moving Javascript to end of HTML

    Details

    • Feedback Policy:

      JIRA feedback is collected from a number of different sources and is evaluated when planning the product roadmap. If you would like to know more about how JIRA Product Management uses customer input during the planning process, please see our post on Atlassian Answers.

      Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Short version: After moving Javascript references to the end of the page templates, we saw initial page render drop from approximately 12 seconds to just over 1. Shame it doesn't completely work after that...

      Long version:

      Like many people, we're currently using Jira over HTTPS. This means (as you guys have already blogged) that all JS files are loaded sequentially and not cached. The vast majority of JS files referenced are in the <head> of the page, which means it can't even start to render the body until they're all loaded. This is particularly bad for us because not only are we using a remotely-hosted Jira (and so each JS file load seems to take at least 100ms, often much more) but we've installed the Jira Labels plugin, which adds 10-15 more JS files to most pages. Hence, 12 seconds before render.

      I took the <script> tags from /includes/decorators/header.jsp and created a new javascript.jsp. (I also moved the webResourceManager.includeResources(out) call) Then I added an include of this file to footer.jsp, right before the </body>. The page was then able to render completely before most of the JS had been loaded.

      Ideally, everything should work fine after this. Unfortunately, it's not always the case - several parts of the page template use inline JS which execute as soon as they're loaded. In some cases, e.g. the auto-completing user picker, the code is referencing YUI functions which haven't been loaded yet. What the code should be doing is deferring until the page is either fully loaded (by onLoad) or, even better, the DOM is ready (see: http://dean.edwards.name/weblog/2005/09/busted/ and follow-ons).

      The speed of Jira is a major issue for us (Linden Lab); making these tweaks would be of significant value.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                yoz Yoz Grahame
              • Votes:
                10 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: