Repit Q-Cache
R/Q Middleware for short-term caching in AWS Lambda.
About
This module is a wrapper for @repit/lambda-cache.
Installation
$ npm install @repit/q-cache --save
Usage
'use strict'
const q = require('@repit/q')()
const cache = require('@repit/q-cache')
q(cache({
// Specify if cache should be invalidated.
invalidate: true, // Default: true
// Set a custom cache key.
key: 'cache' // Default: 'cache'
}))
q((req, res) => {
req.cache // The Cache object.
res.cache // The Cache object.
})
exports.handler = q.handler
License
MIT