This commit is contained in:
barisusakli
2015-09-11 16:18:32 -04:00
parent 160cf93802
commit a64cbbc6df
7 changed files with 15 additions and 54 deletions

View File

@@ -92,8 +92,7 @@ module.exports = function(Meta) {
process.send({
action: 'css-propagate',
cache: minified[0],
acpCache: minified[1],
hash: Meta.css.hash
acpCache: minified[1]
});
}
@@ -186,14 +185,6 @@ module.exports = function(Meta) {
Meta.css[destination] = lessOutput.css;
if (destination === 'cache') {
// Calculate css buster
var hasher = crypto.createHash('md5');
hasher.update(lessOutput.css, 'utf-8');
Meta.css.hash = hasher.digest('hex').slice(0, 8);
}
// Save the compiled CSS in public/ so things like nginx can serve it
if (nconf.get('isPrimary') === 'true') {
Meta.css.commitToFile(destination);

View File

@@ -18,7 +18,6 @@ module.exports = function(Meta) {
Meta.js = {
cache: '',
map: '',
hash: +new Date(),
scripts: {
base: [
'public/vendor/jquery/js/jquery.js',
@@ -142,8 +141,7 @@ module.exports = function(Meta) {
process.send({
action: 'js-propagate',
cache: Meta.js.cache,
map: Meta.js.map,
hash: Meta.js.hash
map: Meta.js.map
});
}
@@ -161,9 +159,6 @@ module.exports = function(Meta) {
Meta.js.map = message.sourceMap;
onComplete();
break;
case 'hash':
Meta.js.hash = message.payload;
break;
case 'error':
winston.error('[meta/js] Could not compile client-side scripts! ' + message.payload.message);
minifier.kill();

View File

@@ -29,9 +29,7 @@ SocketMeta.reconnected = function(socket, data, callback) {
emitter.on('nodebb:ready', function() {
websockets.server.sockets.emit('event:nodebb.ready', {
general: meta.config['cache-buster'],
css: meta.css.hash,
js: meta.js.hash
'cache-buster': meta.config['cache-buster']
});
});