Skip to content

Cache

Under the cache config option Lighthouse can be configured to use an external cache system. Currently, only Redis is supported (in additional to in-memory caching).

redis_addr

string optional

The redis_addr option sets the address of a Redis server to be used as a cache backend. If set, Lighthouse initializes Redis caching at startup. If not set or empty, no external cache is used and in-memory defaults apply.

Typical formats:

  • hostname:port (e.g. localhost:6379)
  • ip:port (e.g. 10.0.0.5:6379)
config.yaml
cache:
  redis_addr: "localhost:6379"

username

string optional

Sets the Redis ACL username used to authenticate to the server. Leave empty when Redis is configured without ACL users.

config.yaml
cache:
  redis_addr: "localhost:6379"
  username: "app-user"

password

string optional

Sets the password for Redis authentication. Used with or without username depending on your Redis setup.

config.yaml
cache:
  redis_addr: "localhost:6379"
  password: "s3cr3t-pass"

redis_db

integer optional

Selects the Redis logical database index to use. Defaults to 0 if not set. Common deployments use 0; choose another index when sharing a Redis instance with other applications.

config.yaml
cache:
  redis_addr: "localhost:6379"
  redis_db: 1