Node.js/Express Caching Node.js/Express Caching express express

Node.js/Express Caching


var express = require('express');var app = express.createServer();var oneYear = 31557600000;app.use(express.static(__dirname + '/public', { maxAge: oneYear }));app.use(express.errorHandler());app.get('/', function(req, res){  res.send('hello world');});app.listen(3000);

Executing the code above, and navigating to a test.html page which lies in /public directory and has a test image gives me the following response headers and Chrome Audit is just fine on my PC (Chrome 17.0.963.83, Linux, Node 0.6.13, Express latest). You should double check if it is really in production mode.

Accept-Ranges:bytesCache-Control:public, max-age=31557600Connection:keep-aliveDate:Fri, 23 Mar 2012 22:52:24 GMTETag:"120877-1278958150000"Last-Modified:Mon, 12 Jul 2010 18:09:10 GMTX-Powered-By:Express