Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64348

Improve ajax template fetching

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      These changes will largely be covered by behat tests however we can confirm with some manual tests.

      1. Create a couple of courses and enrol a few users in those courses
      2. Log in as a user
      3. View the dashboard
      4. CONFIRM everything loads correctly
      5. In a separate window, purge the Moodle caches
      6. Reload the dashboard for the user
      7. CONFIRM that everything loads correctly again (this will be requesting everything from the server again because the caches are empty)
      8. Open the message drawer
      9. Find another user and send them a few messages
      10. CONFIRM it all loads and renders correctly
      11. Purge the Moodle caches again from another window
      12. Reload the page for the user and open the message drawer again
      13. View the conversation
      14. CONFIRM it all loads correctly
      Show
      These changes will largely be covered by behat tests however we can confirm with some manual tests. Create a couple of courses and enrol a few users in those courses Log in as a user View the dashboard CONFIRM everything loads correctly In a separate window, purge the Moodle caches Reload the dashboard for the user CONFIRM that everything loads correctly again (this will be requesting everything from the server again because the caches are empty) Open the message drawer Find another user and send them a few messages CONFIRM it all loads and renders correctly Purge the Moodle caches again from another window Reload the page for the user and open the message drawer again View the conversation CONFIRM it all loads correctly
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-64348-master

      Description

      At the moment when we fetch templates via ajax we do so one at a time because the client parses each template individually as it receives it and then fetches each other template it needs as it finds out that it needs them during the parsing.

      This can result in 10s of network requests to the server to render a single template that has lots of other embedded templates.

      However often times we know that the single template can't be rendered without all of the subsequent templates so rather than send back a single template the server should pre-parse the template being requested to find all of the other templates that are required to render this one and should send those back to the client in the same request.

      This would allow the client to get all of the templates it needs in a single network request rather than in multiple subsequent requests.

      This would be a massive win both in terms of number of requests and speed of template rendering for the client.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ryanwyllie Ryan Wyllie
                Reporter:
                ryanwyllie Ryan Wyllie
                Peer reviewer:
                Andrew Nicols
                Integrator:
                Jake Dallimore
                Tester:
                Anna Carissa Sadia
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Ryan Wyllie, Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m