connect-response-cache

Cache responses from your application.

connect-response-cache

Cache responses from your application.

npm install connect-response-cache
var connectResponseCache = require("connect-response-cache");
 
var oneMinute = 1000 * 60;
 
var app = connect()
    .use(connectResponseCache({maxAge: oneMinute}))
    .use(function(requestresponse) {
        response.writeHead(200, {
            "Content-Type": "application/json"
        });
        response.end(JSON.stringify({"message": "Hello!"}));
    });
    
var server = http.createServer(app).listen(3000);