Split cache between prod, dev, staging environments

We’re currently using the OrmLiteCacheClient, so the cache is part of the production, staging, or beta databases. But we’re looking into switching to Redis, and I don’t think we have the need for 3 separate Redis instances for these environments, so I’m wondering if something built into SS will let us customize the cache key per environment. Maybe customizing the UrnId instance used?

You can use a different Redis DB per environment. A redis instance usually comes with 12 if I recall correctly.

You can specify which Redis database to use in the Redis Connection String, e.g:

container.Register<IRedisClientsManager>(c => 
    new RedisManagerPool("host:6379?db=1"));

Alternatively you can specify a prefix to use with any ICacheClient:

container.Register(c => 
    c.Resolve<IRedisClientsManager>().GetCacheClient().WithPrefix("site1"));