Skip to content

Commit

Permalink
MDL-66367 core: don't cache templates if templaterev is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Sep 4, 2019
1 parent 9e5edc7 commit af8a707
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/templates.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/amd/build/templates.min.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/amd/src/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ define([
* @return {Object} jQuery promise resolved with the template source
*/
var getTemplatePromiseFromCache = function(searchKey) {
// Do not cache anything if templaterev is not valid.
if (M.cfg.templaterev <= 0) {
return null;
}

// First try the cache of promises.
if (searchKey in templatePromises) {
return templatePromises[searchKey];
Expand Down

0 comments on commit af8a707

Please sign in to comment.