Core Concepts — Cache Providers, Fail-Safe & Tags
L2StableNuGet: v1.0.0Local HEAD: v2.0.0AOT: Full
EricksonLopez.Caching models cache operations as explicit Result<T> contracts with bounded entry lifetimes and tenant isolation.
ICacheProvider: ExposesGetAsync<T>,GetManyAsync<T>,GetOrCreateAsync<T>,SetAsync<T>,SetManyAsync<T>,RemoveAsync,RemoveManyAsync,RemoveByPrefixAsync,ExistsAsync,ExpireAsync, andRefreshAsync.ITaggedCacheProvider: ExtendsICacheProviderwithRemoveByTagAsyncandRemoveByTagsAsyncfor logical invalidation across heterogeneous keys.
CacheEntryOptions & HybridCacheEntryOptions
Section titled “CacheEntryOptions & HybridCacheEntryOptions”CacheEntryOptionssupportsFromAbsolute,FromSliding, andFromAbsoluteWithFailSafefactory helpers alongsideTags.CacheEntryOptions.MaxAllowedDurationis enforced atTimeSpan.FromDays(3650)in source (CacheEntryOptions.cs:15), overriding older changelog prose that mentioned 365 days.HybridCacheEntryOptionsextendsCacheEntryOptionswithLocalCacheDuration,DistributedCacheDuration, andHybridCacheEntryOptions.FromDurations(local, distributed).
Tenant Isolation & Native AOT Serialization
Section titled “Tenant Isolation & Native AOT Serialization”AddTenantPartitionedCache(services, sp => tenantResolver(sp))wraps cache keys in tenant-scoped partitions.- For Native AOT builds, pass a source-generated
JsonSerializerContext(JsonSerializerOptions) toSystemTextJsonCacheSerializerinstead ofSystemTextJsonCacheSerializer.Default.