Created
February 14, 2014 16:18
-
-
Save nikmartin/9004005 to your computer and use it in GitHub Desktop.
Node + Express Cache Control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ONE_DAY = 86400000; | |
app.use(function (req, res, next) { | |
res.setHeader('Expires', new Date(Date.now() + ONE_DAY).toUTCString()); | |
res.header('X-powered-by', 'Super Awesome Server'); | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment