VitreousRedisCachingOptions class
Namespace: Vitreous.Caching.Redis
Assembly: Vitreous.Caching.Redis.dll
Configuration options for the Vitreous Redis caching backend.
public sealed class VitreousRedisCachingOptionsInheritance
Section titled “Inheritance”object ← VitreousRedisCachingOptions
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties
Section titled “Properties”ConnectionString
Section titled “ ConnectionString”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; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
DefaultAbsoluteExpiration
Section titled “ DefaultAbsoluteExpiration”Absolute expiration applied when a query sets neither AbsoluteExpiration nor SlidingExpiration. Default: null, meaning such entries never expire.
public TimeSpan? DefaultAbsoluteExpiration { get; set; }Property Value
Section titled “Property Value”EnableStampedeProtection
Section titled “ EnableStampedeProtection”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; }Property Value
Section titled “Property Value”JsonSerializerOptions
Section titled “ JsonSerializerOptions”Options used by the default System.Text.Json cache serializer. Default: camelCase. Ignored when a custom IVitreousCacheSerializer is registered.
public JsonSerializerOptions JsonSerializerOptions { get; set; }Property Value
Section titled “Property Value”KeyPrefix
Section titled “ KeyPrefix”Prefix prepended to every cache key to avoid collisions.
Default: “vitreous:”.
public string KeyPrefix { get; set; }Property Value
Section titled “Property Value”TagPrefix
Section titled “ TagPrefix”Prefix used for the Redis Sets that track tag → key mappings.
Default: “vtag:”.
public string TagPrefix { get; set; }