Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/themost-framework/redis
Most Web Framework Redis Cache Module
https://github.com/themost-framework/redis
Last synced: about 6 hours ago
JSON representation
Most Web Framework Redis Cache Module
- Host: GitHub
- URL: https://github.com/themost-framework/redis
- Owner: themost-framework
- License: bsd-3-clause
- Created: 2018-08-20T10:53:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T18:02:17.000Z (7 months ago)
- Last Synced: 2024-10-14T08:50:18.253Z (about 1 month ago)
- Language: JavaScript
- Size: 186 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @themost/redis
Most Web Framework Redis Cache Module`@themost/redis` implements the usage of [Redis](https://redis.io) as caching strategy of a [MOST Web Framework](https://github.com/themost-framework) application.
## Installation
```bash
npm i @themost/redis
```## Configuration
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 section`redis/options` contains options about configuring the connection to the Redis server.
Read more about connect options at [ioredis](https://github.com/redis/ioredis#connect-to-redis)
### Connection pooling
`@themost/redis` uses [generic-pool](https://github.com/coopernurse/node-pool) for connection pooling.
Configure `redis/pool` section to set minimum and maximum number of connections to be used.Read about connection pooling options at [generic-pool](https://github.com/coopernurse/node-pool#documentation)
## Usage
Configure application services to use `RedisCacheStrategy` as caching service.
```json
{
"services": [
{
"serviceType": "@themost/data#DataCacheStrategy",
"strategyType": "@themost/redis#RedisCacheStrategy"
}
]
}
```