Skip to content

VitreousRedisCachingOptions class

Namespace: Vitreous.Caching.Redis
Assembly: Vitreous.Caching.Redis.dll

Configuration options for the Vitreous Redis caching backend.

public sealed class VitreousRedisCachingOptions

object ← VitreousRedisCachingOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Redis connection string (e.g. “localhost:6379” or a full StackExchange.Redis configuration string). Required when not providing an existing IConnectionMultiplexer in DI.

public string? ConnectionString { get; set; }

string?

The multiplexer created from this string does not abort when Redis is unreachable (abortConnect=false) and fails commands fast while disconnected, so an outage degrades to cache misses instead of blocking or failing requests. It reconnects in the background.

Absolute expiration applied when a query sets neither AbsoluteExpiration nor SlidingExpiration. Default: null, meaning such entries never expire.

public TimeSpan? DefaultAbsoluteExpiration { get; set; }

TimeSpan?

When true (the default), concurrent cache misses for the same key within this process share a single handler run instead of all calling the handler. Callers that share a run receive the same result instance.

public bool EnableStampedeProtection { get; set; }

bool

Options used by the default System.Text.Json cache serializer. Default: camelCase. Ignored when a custom IVitreousCacheSerializer is registered.

public JsonSerializerOptions JsonSerializerOptions { get; set; }

JsonSerializerOptions

Prefix prepended to every cache key to avoid collisions. Default: “vitreous:”.

public string KeyPrefix { get; set; }

string

Prefix used for the Redis Sets that track tag → key mappings. Default: “vtag:”.

public string TagPrefix { get; set; }

string