1.2.0 • Published 10 years ago

koa-snapshot v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

snapshot

NPM version build status Coveralls David deps node version npm download Gittip

take snapshot when request, cache by request path.

Install

npm install koa-snapshot

Usage

var koa = require('koa');
var snapshot = require('koa-snapshot');
var app = koa();

app.use(snapshot());

Options

Use your own cache client by options.cache. If do not present options.cache, snapshot will create a lru-cache instance with the options.

default options for lru-cache:

{
  max: 50 * 1024 * 1024,  // 50mb
  maxAge: 12 * 60 * 60 * 1000,  // 12h
  length: function (n) {
    return n.length;
  }
}

Turn off Snapshot

You can manually turn off snapshot by set this.noSnapshot = true in every request.

License

MIT

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.0

10 years ago