MDL-66367 core: use templaterev as the cache key when getting templates

This commit is contained in:
Mark Nelson
2019-09-04 12:54:02 +02:00
parent 988482f077
commit 9e5edc7f68
3 changed files with 5 additions and 5 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -89,7 +89,7 @@ define([
}
// Now try local storage.
var cached = storage.get('core_template/' + searchKey);
var cached = storage.get('core_template/' + M.cfg.templaterev + ':' + searchKey);
if (cached) {
// Add this to the module cache for future.
templateCache[searchKey] = cached;
@@ -175,7 +175,7 @@ define([
// Cache all of the dependent templates because we'll need them to render
// the requested template.
templateCache[tempSearchKey] = data.value;
storage.set('core_template/' + tempSearchKey, data.value);
storage.set('core_template/' + M.cfg.templaterev + ':' + tempSearchKey, data.value);
if (data.component == component && data.name == name) {
// This is the original template that was requested so remember it to return.
@@ -220,7 +220,7 @@ define([
if (requests.length) {
// We have requests to send so resolve the deferred with the promises.
serverRequestsDeferred.resolve(ajax.call(requests, true, false, false, 0, M.cfg.themerev));
serverRequestsDeferred.resolve(ajax.call(requests, true, false, false, 0, M.cfg.templaterev));
} else {
// Nothing to load so we can resolve our deferred.
serverRequestsDeferred.resolve();