Skip to content
Myr

Added "cache views" setting, defaulting to enabled in "production" env

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 4b99665 · Browse files · 2 files+6 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−7 removed

  • other:+6 added−7 removed

2 files+6 added−7 removed

modified:lib/express/server.js+5 added-6 removed
35 unmodified lines
3637 // Default "home" to / 38 this.set('home', '/');3940 // DEPRECATED: remove in 1.041 if (process.env.EXPRESS_ENV) {42 process.env.NODE_ENV = process.env.EXPRESS_ENV;43 console.warn('\x1b[33mWarning\x1b[0m: EXPRESS_ENV is deprecated, use NODE_ENV.');44 }4540 // TODO: remove when Connect removes "Server" ...41 this.showVersion = false;4243 // Set "env" to NODE_ENV, defaulting to "development"
20 unmodified lines
64 this.__defineGetter__('router', function(){65 this.__usedRouter = true;66 return fn;67 });6869 // Default production configuration70 this.configure('production', function(){71 this.enable('cache views');72 });73};7475/**76 * Inherit from `connect.Server`.
288 unmodified lines
modified:lib/express/view.js+1 added-1 removed
156 unmodified lines
157 , options = options || {}158 , helpers = app.viewHelpers159 , dynamicHelpers = app.dynamicViewHelpers160 , viewOptions = app.settings['view options']161 , cacheTemplates = 'production' == app.settings.env;161 , cacheTemplates = app.settings['cache views'];162163 // Mixin "view options"164 if (viewOptions) options = merge(clone(viewOptions), options);165
87 unmodified lines