Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't cache templates in development mode

  • Loading branch information...
commit adf2d964fdb563b121b02807c1e2929ab1bf9897 1 parent 1abcd26
Kellen Presley authored
2  picard/lib/picard/request_extensions.js
@@ -114,7 +114,7 @@ var locals = {
_cached_template: function(request, filename, callback){
- if ( template_cache[filename] )
+ if ( template_cache[filename] && Picard.env.mode != 'development' )
fs.readFile(filename, function(err, body){
6 sample_app/config/env.js
@@ -2,10 +2,10 @@ require('../../picard/lib/picard')
Picard.env = {
root: __filename.replace(/\/config\/env.js$/, ''),
- mode: 'development', /* Picard currently only cares about production and development modes */
port: 9900,
public_dir: '/public',
- views: '/views'
+ views: '/views',
+ mode: 'development' // In development mode, requests parameters will be logged.
+} // Additionally, view templates will not be cached.

1 comment on commit adf2d96


Might want to consider keying off of :cache_templates (or something similar) instead of the environment. Using the environment is not as flexible and you will run into issues later, i.e: I want to test a bug with the caching, but I can't do that in development mode and now have to run everything in production mode, blah blah blah.

Please sign in to comment.
Something went wrong with that request. Please try again.