diff --git a/loader.js b/loader.js index 24b2ab403372..17958ea55717 100644 --- a/loader.js +++ b/loader.js @@ -29,7 +29,8 @@ var pidFilePath = __dirname + '/pidfile', css: { cache: undefined, acpCache: undefined - } + }, + templatesCompiled: false }; Loader.init = function(callback) { @@ -101,6 +102,12 @@ Loader.addWorkerEvents = function(worker) { }); } + if (Loader.templatesCompiled && !worker.isPrimary) { + worker.send({ + action: 'templates:compiled' + }); + } + break; case 'restart': @@ -130,6 +137,8 @@ Loader.addWorkerEvents = function(worker) { }, worker.pid); break; case 'templates:compiled': + Loader.templatesCompiled = true; + Loader.notifyWorkers({ action: 'templates:compiled', }, worker.pid); diff --git a/public/src/app.js b/public/src/app.js index 65038d343ebb..8875bd2d64ed 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -56,8 +56,8 @@ app.cacheBuster = null; socket.removeAllListeners('event:nodebb.ready'); socket.on('event:nodebb.ready', function(data) { - if (!app.cacheBusters || app.cacheBusters['cache-buster'] !== data['cache-buster']) { - app.cacheBusters = data; + if (!app.cacheBuster || app.cacheBuster !== data['cache-buster']) { + app.cacheBuster = data['cache-buster']; app.alert({ alert_id: 'forum_updated',