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

Add revision and caching support for Moodle YUI modules [Patch]

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: JavaScript
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      MDL-22920 added support for easily loading custom YUI modules (aka Moodle YUI modules) via the new yui_module function. This function causes these modules to get loaded via yui_combo.php (regardless of the useexternalyui or yuicomboloading settings).

      Currently, yui_combo.php does not support caching or revisions. Originally this wasn't necessary as YUI and YUI Galleries (the only JS previously loaded by yui_combo) had their own versioning. Moodle YUI modules need to be versioned so they can be cached effectively and still updated when purging caches.

      The attached patch adds support for including $CFG->jsrev in the yui_combo URLs for Moodle YUI modules. The $CFG->cachejs setting is also supported.

      I did not add cachejs or jsrev support to YUI modules as it has its own built in versioning. Similarly I didn't modify YUI Galleries as yui_module already supports gallery versions. This means that if cachejs is off, YUI modules and YUI Galleries will still be far-future cached. Only Moodle YUI modules will not be cached if cachejs is off. I think this is what should happen because YUI modules should only be changed upstream.

      Please see the forum post: http://moodle.org/mod/forum/discuss.php?d=154359

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samhemelryk Sam Hemelryk
                Reporter:
                blt04 Brandon Turner
                Tester:
                Nobody
                Participants:
                Component watchers:
                Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10