MDL-66367 core: don't cache templates if templaterev is invalid

This commit is contained in:
Mark Nelson 2019-08-13 00:25:04 +08:00
parent 9e5edc7f68
commit af8a70756f
3 changed files with 7 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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];