Clear the view cache completely

- directly clear the cache rather than relying on disabling it to clear it.
This commit is contained in:
Hannah Wolfe 2013-09-17 02:26:28 +01:00
parent 79f75865a1
commit 30a2cfe6e2

View File

@ -177,7 +177,9 @@ function activateTheme() {
var stackLocation = _.indexOf(server.stack, _.find(server.stack, function (stackItem, key) {
return stackItem.route === '' && stackItem.handle.name === 'settingEnabled';
}));
server.disable('view cache');
// clear the view cache
server.cache = {};
server.disable(server.get('activeTheme'));
server.set('activeTheme', ghost.settings('activeTheme'));
server.enable(server.get('activeTheme'));
@ -211,10 +213,6 @@ function manageAdminAndTheme(req, res, next) {
} else {
activateTheme();
}
} else {
if (server.env === 'production' && server.disabled('view cache')) {
server.enable('view cache');
}
}
next();