Skip to content

Instantly share code, notes, and snippets.

@nikmartin
Created February 14, 2014 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikmartin/9004005 to your computer and use it in GitHub Desktop.
Save nikmartin/9004005 to your computer and use it in GitHub Desktop.
Node + Express Cache Control
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