Redis Cache
This integration provides caching capabilities using Redis. It implements the framework's Cache.Service interface and is used by CMS integrations (Strapi, Contentful) to cache pages, components, and configuration.
In this section
- How to set up - Installation and configuration guide
- Features - Capabilities and cache operations
- Usage - Examples and best practices
Installation
npm install @o2s/integrations.redis --workspace=@o2s/api
Environment variables
| name | type | description | required | default |
|---|---|---|---|---|
| CACHE_ENABLED | boolean | enables/disables cache | no | false |
| CACHE_TTL | number | key expiration time (seconds) | no | 300 |
| CACHE_REDIS_HOST | string | Redis host | yes | - |
| CACHE_REDIS_PORT | number | Redis port | yes | - |
| CACHE_REDIS_PASS | string | Redis password | no | - |
Quick start
- Install the package
- Set up a Redis instance (see How to set up)
- Configure environment variables
- Set
CACHE_ENABLED=true