added cache buster to require.js files - fixes #687

v1.18.x
Julian Lam 11 years ago
parent 6ad28dadd4
commit d8183c056c

@ -6,7 +6,7 @@
<link rel="icon" type="image/x-icon" href="{brand:favicon}" />
<link href="{cssSrc}" rel="stylesheet" media="screen">
<link rel="stylesheet" href="{relative_path}/vendor/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{relative_path}/css/theme.css{cache-buster}" />
<link rel="stylesheet" type="text/css" href="{relative_path}/css/theme.css?{cache-buster}" />
{link_tags}
<!-- BEGIN pluginCSS -->
<link rel="stylesheet" href="{pluginCSS.path}">
@ -22,6 +22,7 @@
require.config({
baseUrl: "{relative_path}/src/modules",
waitSeconds: 3,
urlArgs: "{cache-buster}",
paths: {
"forum": '../forum'
}

@ -99,7 +99,7 @@ var path = require('path'),
link_tags: linkTags,
clientScripts: clientScripts,
navigation: custom_header.navigation,
'cache-buster': meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '',
'cache-buster': meta.config['cache-buster'] ? 'v=' + meta.config['cache-buster'] : '',
allowRegistration: meta.config.allowRegistration === undefined || parseInt(meta.config.allowRegistration, 10) === 1
};
@ -132,14 +132,9 @@ var path = require('path'),
}, function(err, stdOut) {
if (!err) {
meta.config['cache-buster'] = stdOut.trim();
if (global.env === 'development') {
winston.info('[init] Cache buster value set to: ' + stdOut);
}
// winston.info('[init] Cache buster value set to: ' + stdOut);
} else {
if (global.env === 'development') {
winston.warn('[init] Cache buster not set');
}
winston.warn('[init] Cache buster not set');
}
});
}

Loading…
Cancel
Save