Express-style in-memory cache middleware
$ npm install moola-memory
# OR
$ yarn add moola-memory
const express = require('express')
const app = express()
const cache = require('moola-memory')
app.use(cache(duration: 5 // Duration to cache. Defaults to 30s))
app.get('/', (req, res) => {
res.sendCached({test: true}) // The body will now be cached for 5 seconds
})
app.listen(8989)
Contributions are welcome!
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Or open up a issue.
Licensed under the MIT License.