diff --git a/source/lib/archetypes/app/default/application.json b/source/lib/archetypes/app/default/application.json index 70f9bb90f..d5bfe8041 100644 --- a/source/lib/archetypes/app/default/application.json +++ b/source/lib/archetypes/app/default/application.json @@ -2,5 +2,11 @@ { "settings": [ "master" ], "specs": {} + }, + { + "settings": [ "environment:development" ], + "staticHandling": { + "forceUpdate": true + } } ] diff --git a/source/lib/archetypes/app/full/application.json b/source/lib/archetypes/app/full/application.json index 8f89636c9..506b4a064 100644 --- a/source/lib/archetypes/app/full/application.json +++ b/source/lib/archetypes/app/full/application.json @@ -42,5 +42,11 @@ } } + }, + { + "settings": [ "environment:development" ], + "staticHandling": { + "forceUpdate": true + } } ] diff --git a/source/lib/archetypes/app/simple/application.json b/source/lib/archetypes/app/simple/application.json index 70f9bb90f..d5bfe8041 100644 --- a/source/lib/archetypes/app/simple/application.json +++ b/source/lib/archetypes/app/simple/application.json @@ -2,5 +2,11 @@ { "settings": [ "master" ], "specs": {} + }, + { + "settings": [ "environment:development" ], + "staticHandling": { + "forceUpdate": true + } } ] diff --git a/source/lib/middleware/mojito-handler-static.js b/source/lib/middleware/mojito-handler-static.js index 2c9060638..8a10855ae 100644 --- a/source/lib/middleware/mojito-handler-static.js +++ b/source/lib/middleware/mojito-handler-static.js @@ -237,19 +237,14 @@ function staticProvider(store, globalLogger) { 'Content-Type': mimetype + (charset ? '; charset="' + charset + '"' : ''), 'Content-Length': stat.size, - //"Last-Modified": stat.ctime.toUTCString(), - // TODO: [Issue 91] See todo below - 'Last-Modified': new Date().toUTCString(), + 'Last-Modified': (options.forceUpdate) ? new Date().toUTCString() : stat.ctime.toUTCString(), 'Cache-Control': 'public max-age=' + (maxAge / 1000), 'ETag': etag(stat) }; - // TODO: [Issue 91] Removed for dev, need to add a switch - // here - // Conditional GET - //if (!modified(req, headers)) { - // return notModified(res, headers); - //} + if (!options.forceUpdate && !modified(req, headers)) { + return notModified(res, headers); + } // logger.log('(staticProvider) serving static file: ' + // filename);