Commit 0d5fb7340ec2bf87d646b60b9521f924c2744ac1

Authored by Adhidarma Hadiwinoto
1 parent 8adc73c9fd
Exists in master

isNoTemplateCache

Showing 1 changed file with 13 additions and 1 deletions Side-by-side Diff

... ... @@ -141,6 +141,18 @@ function renderConfigAskDelete(req, res) {
141 141 });
142 142 }
143 143  
  144 +function isNoTemplateCache() {
  145 + var retval = false;
  146 + try {
  147 + retval = config.expresso.no_template_cache.toUpperCase() == 'YES';
  148 + }
  149 + catch(err) {
  150 + return retval;
  151 + }
  152 +
  153 + return retval;
  154 +}
  155 +
144 156 function createServer() {
145 157 if (!config.expresso || !config.expresso.listen_port) {
146 158 console.log('Not starting expresso admin UI');
... ... @@ -149,7 +161,7 @@ function createServer() {
149 161  
150 162 nunjucks.configure(view_path, {
151 163 autoescape: true,
152   - noCache: true,
  164 + noCache: isNoTemplateCache(),
153 165 express: app
154 166 });
155 167