Browse Source

Document cache stores

pull/15/head
Luke Childs 8 years ago
parent
commit
471feae181
  1. 25
      README.md

25
README.md

@ -69,6 +69,31 @@ const onionoo = new Onionoo({
});
```
## Cache Stores
This module makes use of [`node-cache-manager`](https://github.com/BryanDonovan/node-cache-manager) to support multiple cache stores. By default we store cached responses in memory. You can easily disable the cache or use a more scalable cache store such as Redis by using `node-cache-manager`'s [store engine](https://github.com/BryanDonovan/node-cache-manager#store-engines) modules.
Disable cache:
```js
const Onionoo = require('onionoo');
const onionoo = new Onionoo({
cache: false
});
```
Use persistent Redis cache:
```js
const Onionoo = require('onionoo');
const redisStore = require('cache-manager-redis');
const onionoo = new Onionoo({
cache: {
store: redisStore
}
});
```
## License
MIT © Luke Childs

Loading…
Cancel
Save