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

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 2.0
    • JavaScript
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      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

            samhemelryk Sam Hemelryk
            blt04 Brandon Turner (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.