sccache/docs/Redis.md

1.4 KiB

Redis

Set SCCACHE_REDIS to a Redis url in format redis://[[<username>]:<passwd>@]<hostname>[:port][/?db=<db>] to store the cache in a Redis instance. Redis can be configured as a LRU (least recently used) cache with a fixed maximum cache size. Set maxmemory and maxmemory-policy according to the Redis documentation. The allkeys-lru policy which discards the least recently accessed or modified key fits well for the sccache use case.

Redis over TLS is supported. Use the rediss:// url scheme (note rediss vs redis). Append #insecure the the url to disable hostname verification and accept self-signed certificates (dangerous!). Note that this also disables SNI.

Set SCCACHE_REDIS_TTL in seconds if you don't want your cache to live forever. This will override the default behavior of redis.

Examples

Use the local Redis instance with no password:

SCCACHE_REDIS=redis://localhost

Use the local Redis instance on port 6379 with password qwerty:

SCCACHE_REDIS=redis://:qwerty@localhost:6379

Use the 192.168.1.10 Redis instance on port 6380 with username alice, password qwerty123 and database 12 via TLS connection:

SCCACHE_REDIS=rediss://alice:qwerty123@192.168.1.10:6380/?db=12