@repit/q-cache

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @repit/q-cache

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • sumanion