@themost/redis
TypeScript icon, indicating that this package has built-in type declarations

5.3.1 • Public • Published

@themost/redis

Most Web Framework Redis Cache Module

@themost/redis implements the usage of Redis as caching strategy of a MOST Web Framework application.

Installation

npm i @themost/redis

Configuration

Add settings/redis configuration section in your application configuration.

    {
        "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

Connection pooling

@themost/redis uses generic-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

Usage

Configure application services to use RedisCacheStrategy as caching service.

{
    "services": [
        {
            "serviceType": "@themost/data#DataCacheStrategy",
            "strategyType": "@themost/redis#RedisCacheStrategy"
        }
    ]
}

Package Sidebar

Install

npm i @themost/redis

Weekly Downloads

60

Version

5.3.1

License

BSD-3-Clause

Unpacked Size

13.4 kB

Total Files

5

Last publish

Collaborators

  • themost