Skip to content

Node.js based forum software built for the modern web

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

Julian Lamd8183c056c5f
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index 1e2c5b2bca..8ab37bd63e 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -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'
}
diff --git a/src/webserver.js b/src/webserver.js
index 2cca579768..63995e8cc4 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -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');
}
});
}