diff --git a/lib/express/plugins/view.js b/lib/express/plugins/view.js index e4a64ef85e..536d2832aa 100644 --- a/lib/express/plugins/view.js +++ b/lib/express/plugins/view.js @@ -61,7 +61,8 @@ exports.View = Plugin.extend({ */ render: function(view, options) { - var self = this, + var cache, + self = this, options = options || {}, path = set('views') + '/' + view, type = path.split('.').slice(-2)[0], @@ -81,8 +82,8 @@ exports.View = Plugin.extend({ else self.halt(200, content) } - if (set('cache view contents') && self.cache.get('view:' + path)) - render(self.cache.get('view:' + path)) + if (set('cache view contents') && (cache = self.cache.get('view:' + path))) + render(cache) else fs.readFile(path, function(err, content){ if (err) throw err