Most Web Framework Redis Cache Module
npm install @themost/redis@themost/redis implements the usage of Redis as caching strategy of a MOST Web Framework application.
``bash`
npm i @themost/redis
Add settings/redis configuration section in your application configuration.
`json`
{
"settings": {
"redis": {
"options": {
"host": "127.0.0.1",
"port": 6379
},
"pool": {
"min": 2,
"max": 25
}
}
}
}
The sectionredis/options contains options about configuring the connection to the Redis server.
Read more about connect options at ioredis
@themost/redis uses generic-pool for connection pooling.redis/pool
Configure section to set minimum and maximum number of connections to be used.
Read about connection pooling options at generic-pool
Configure application services to use RedisCacheStrategy as caching service.
`json``
{
"services": [
{
"serviceType": "@themost/data#DataCacheStrategy",
"strategyType": "@themost/redis#RedisCacheStrategy"
}
]
}