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

Change YUI loader to use shorter path for Moodle modules

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      • Open various pages in Moodle
      • Check that all JS continues to work as expected
      • Confirm that there were no (new) JS errors displayed
      • *Confirm that the URL when loading modules is now more like

        m/-1/core/popuphelp/popuphelp.js

      Show
      Open various pages in Moodle Check that all JS continues to work as expected Confirm that there were no (new) JS errors displayed *Confirm that the URL when loading modules is now more like m/-1/core/popuphelp/popuphelp.js
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-41878-master

      Description

      There's a max length of approx 1024 characters in the querystring by the YUI loader - this is to prevent issues caused by limitations imposed by various web servers.

      When a URL gets to 1024 characters, the loader breaks it up into multiple queries and issues a new request. So for lots of long module names, you end up more queries.

      At the moment, we give all Moodle modules a path of:

      moodle/$jsrev/component/modname/submodname.(js|css)

      and a similar path for images.

      Since we control the namespaces, and we know that we currently use paths of:

      • moodle
      • 2in3
      • gallery
      • 3.9.1 (or other version number) = yui3

      We can make 'm' an alias for 'moodle' and trim 5 chars off each of our module requests.

      It doesn't seem like much, but it can mean fewer requests and it's a cheap/easy thing to implement.

        Attachments

          Activity

            People

            • Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Petr Skoda
              Integrator:
              Sam Hemelryk
              Tester:
              Ankit Agarwal
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Ryan Wyllie, Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13