Skip to main content

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

nametypedescriptionrequireddefault
CACHE_ENABLEDbooleanenables/disables cachenofalse
CACHE_TTLnumberkey expiration time (seconds)no300
CACHE_REDIS_HOSTstringRedis hostyes-
CACHE_REDIS_PORTnumberRedis portyes-
CACHE_REDIS_PASSstringRedis passwordno-

Quick start

  1. Install the package
  2. Set up a Redis instance (see How to set up)
  3. Configure environment variables
  4. Set CACHE_ENABLED=true