[express/connect.static] Set ‘Last-Modified’ to now to avoid 304 Not Modified

Why do I need this? The right answer is: I don’t need that trick! The example below is just to show how to use routes to intercept requests to a static file. Put router before static. app.use(app.router); app.use(express.static(__dirname + ‘/static’)); Add ‘/*’ handler (don’t forget to call next()) app.get(‘/*’, function(req, res, next){ res.setHeader(‘Last-Modified’, (new Date()).toUTCString());Continue reading “[express/connect.static] Set ‘Last-Modified’ to now to avoid 304 Not Modified”