added cache-buster to template xhr urls -- closed #1392

v1.18.x
Julian Lam 11 years ago
parent 7c00bce63c
commit 126260a027

@ -209,7 +209,7 @@ var ajaxify = ajaxify || {};
callback(templates.cache[template]); callback(templates.cache[template]);
} else { } else {
$.ajax({ $.ajax({
url: RELATIVE_PATH + '/templates/' + template + '.tpl', url: RELATIVE_PATH + '/templates/' + template + '.tpl' + (config['cache-buster'] ? '?v=' + config['cache-buster'] : ''),
type: 'GET', type: 'GET',
success: function(data) { success: function(data) {
callback(data.toString()); callback(data.toString());

@ -39,6 +39,7 @@ apiController.getConfig = function(req, res, next) {
config.defaultLang = meta.config.defaultLang || 'en_GB'; config.defaultLang = meta.config.defaultLang || 'en_GB';
config.environment = process.env.NODE_ENV; config.environment = process.env.NODE_ENV;
config.isLoggedIn = !!req.user; config.isLoggedIn = !!req.user;
config['cache-buster'] = meta.config['cache-buster'] || '';
if (!req.user) { if (!req.user) {
if (res.locals.isAPI) { if (res.locals.isAPI) {

Loading…
Cancel
Save