Skip to content

hxshandle/koa-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status NPM version

koa-cache

koa-cache is a koa middleware which provide cache for app.

Install

npm install koa-cache-it

Usage

var app = require('koa')();
var cache = require('koa-cache-it');
app.use(cache({
          store:redisStore(),
          prefix:"koa-cache-test:"
      }));

app.use(function * controller(){
      this.cache.get('cache-key',function * provider(){
          // do something
          return "your value";
        });
    });

APIs

  • get(key[,function *(){}])
  • set(key,value)
  • destory(key)

About

koa-cache is a koa middleware which provide cache for app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published