Comparing version 1.0.1 to 1.1.0
@@ -79,3 +79,3 @@ | ||
yield set(this.cashKey, obj) | ||
yield set(this.cashKey, obj, this.cash.maxAge || options.maxAge || 0) | ||
} | ||
@@ -92,3 +92,3 @@ | ||
// tell the upstream middleware to cache this response | ||
this.cash = true | ||
this.cash = { maxAge: maxAge } | ||
return false | ||
@@ -95,0 +95,0 @@ } |
{ | ||
"name": "koa-cash", | ||
"description": "HTTP response caching for Koa", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"dependencies": { | ||
"mz": "1", | ||
"bytes": "1", | ||
"bytes": "^2.1.0", | ||
"compressible": "2", | ||
"stream-to-array": "2", | ||
"koa-is-json": "1" | ||
"koa-is-json": "1", | ||
"mz": "^2.0.0", | ||
"stream-to-array": "2" | ||
}, | ||
"devDependencies": { | ||
"koa": "0", | ||
"mocha": "1", | ||
"istanbul": "0", | ||
"koa": "1", | ||
"lru-cache": "2", | ||
"mocha": "^2.3.3", | ||
"should": "4", | ||
"supertest": "0", | ||
"lru-cache": "2", | ||
"istanbul-harmony": "0" | ||
"supertest": "0" | ||
}, | ||
"scripts": { | ||
"test": "NODE_ENV=test mocha --harmony-generators --require should --reporter spec", | ||
"test-cov": "NODE_ENV=test node --harmony-generators ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should", | ||
"test-travis": "NODE_ENV=test node --harmony-generators ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --require should" | ||
"test": "NODE_ENV=test mocha --require should --reporter spec", | ||
"test-cov": "NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should", | ||
"test-travis": "NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --require should" | ||
}, | ||
@@ -25,0 +25,0 @@ "author": { |
@@ -9,3 +9,2 @@ # Koa Cash | ||
[![Downloads][downloads-image]][downloads-url] | ||
[![Gittip][gittip-image]][gittip-url] | ||
@@ -80,3 +79,3 @@ HTTP response caching for Koa. | ||
```js | ||
function set(key, value) { | ||
function set(key, value, maxAge) { | ||
return <yieldable> | ||
@@ -86,2 +85,5 @@ } | ||
Note: `maxAge` is set by `.cash={ maxAge }`. | ||
If it's not set, then `maxAge` will be `0`, which you should then ignore. | ||
#### Example | ||
@@ -141,3 +143,1 @@ | ||
[downloads-url]: https://npmjs.org/package/koa-cash | ||
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square | ||
[gittip-url]: https://www.gittip.com/jonathanong/ |
9448
4
+ Addedbytes@2.5.0(transitive)
+ Addedmz@2.7.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
- Removedbytes@1.0.0(transitive)
- Removedmz@1.3.0(transitive)
- Removednative-or-bluebird@1.2.0(transitive)
Updatedbytes@^2.1.0
Updatedmz@^2.0.0