Permalink
Browse files

Set Cache-Control: max-age for static content (default: 1 day)

  • Loading branch information...
1 parent 8a4f539 commit 771f007f3f49bbe3931a9818be75ad3e6edcf7fa @mingzeke mingzeke committed Jun 16, 2015
Showing with 3 additions and 1 deletion.
  1. +1 −0 config.default.json
  2. +2 −1 lib/app.js
View
@@ -9,6 +9,7 @@
"runner": false
},
"max-request-size": "1MB",
+ "max-age": 86400,
"store": {
"adapter": "sqlite",
"sqlite": {
View
@@ -218,7 +218,8 @@ app.connect = function (callback) {
// look like a bin url) then it gets 404'd - i.e. you can't request /css/style.css
// because it'll return a 404.
app.use(mount, (function () {
- var staticRouter = express.static(path.join(app.get('root'), 'public'));
+ var staticRouter = express.static(path.join(app.get('root'), 'public'),
+ {maxAge: (options['max-age'] || 86400) * 1000});
return function (req, res, next) {
// construct the full request url

0 comments on commit 771f007

Please sign in to comment.