setting cache headers to 0 on development mode

This commit is contained in:
Julian Lam
2013-11-28 17:37:17 -05:00
parent 38da65ee58
commit 0188ea9a3b
4 changed files with 15 additions and 6 deletions

View File

@@ -31,7 +31,9 @@ var nconf = require('nconf'),
var fullPath = path.join(Plugins.staticDirs[req.params.id], relPath);
fs.exists(fullPath, function(exists) {
if (exists) {
res.sendfile(fullPath);
res.sendfile(fullPath, {
maxAge: app.enabled('cache') ? 5184000000 : 0
});
} else {
res.redirect('/404');
}