Very simple cache middleware for restful apis in koa. This aims to be a very thin wrapper over your restful APIs. It simply stores the response body of requests matching a given pattern in memory. There is no way to read, write, or clear the cache, it should just work.
npm install koa-rest-cache
var app = ;var cache = ;app;
cache(options) A function that takes a single
options argument, and returns a function generator that is intended
to be passed to koa's
patternA String or Array of Strings to match incoming request paths against. Supports glob matching and other features provided by minimatch. If no pattern is provided all requests will be cached.
maxAgeA length of time in milliseconds that something should remain in the cache. Defaults to 600000ms (10 minutes).