How to cache the response that was genereated by expressjs route. This route has a lot of database access and changes to it to it are very little. Is there any node module avaialble.
Thanks
connect-cache should do the trick. Add this to your app as a middleware
var connect_cache = require('connect-cache');
app.use(
connect_cache({rules: [{regex: /.*/, ttl: 60000}]})
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With