@tyagoveras/obi-decorator-cache-redis
v1.0.3
Published
# ----------------------
Downloads
3
Readme
Configure this package
----------------------
1 - Create a new file called .obi-cacherc.json
in the root of your project.
2 - Add the following configuration to the file:
{
"connection": {
"url": "redis://localhost:6379"
},
"rootKey": "root",
"allowPersistDataIfNotFound": true,
"ttl": 60
}
3 - Replace the url
value with your Redis server URL.
4 - Replace the rootKey
value with the key you want to use as the root key.
5 - Replace the allowPersistDataIfNotFound
value with true
if you want to persist the data if the key is not found.
6 - Replace the ttl
value with the time to live in seconds.
7 - To disconnect from the Redis server, use the following code:
import { ObiCacheDisconnectInstance } from 'obi-cache';
ObiCacheDisconnectInstance();