koa-boost
Cache middleware for koa
koa-boost
Cache middleware for koa. It stores the responses matching a given pattern.
Installation
npm install koa-boost --save
Usage
Store Cache in Application Memory
const Koa = const boost = const app = app;
Use Redis as Cache Provider
const Koa = const boost = const Redis = const app = const redis = app;
Options
pattern {string|array}
— pattern to match incoming request paths against. Supports glob matching and other features provided by highly optimized wildcard and glob matching library micromatch. Defaults tonull
— all requests will be cached.ttl {integer}
— time in seconds that cached response should remain in the cache. Defaults to60
seconds.