Skip to main content

ZeroAlloc.Cache — Documentation

DocumentDescription
Getting StartedInstall, annotate, register, and inject
Attribute ReferenceAll [Cache] properties and override rules
TelemetryMetrics, tracing spans and OpenTelemetry setup
PerformanceBenchmarks and every case where a hit still allocates

Diagnostics​

IDSeverityDescription
ZC0001WarningSliding = true combined with UseHybridCache = true — sliding TTL is silently ignored by the distributed (L2) tier
ZC0002WarningA cache key parameter is a reference type (excluding string) — ToString() may not produce a stable unique key
ZC0003ErrorUseHybridCache = true without a reference to Microsoft.Extensions.Caching.Hybrid — no proxy is generated for the interface
ZC0004WarningBounded methods on one interface set different MaxEntries values — they share one size-limited cache sized by the first bounded method
ZC0005Warning[Cache] on a method that does not return Task<T> or ValueTask<T> — caching is not applied
ZC0006WarningA nested interface whose containing type is not partial — no proxy is generated for it
ZC0007WarningA generic interface, or one nested in a generic type — no proxy is generated for it
ZC0008WarningA private or protected nested interface, which the namespace-level Add…Cache method cannot name — no proxy is generated for it
ZC0009ErrorA file-local interface — no proxy is generated for it
ZC0010ErrorAn interface whose name differs only in case from another's — only the first is generated
ZC0011WarningIn a NativeAOT or trimmed project, a HybridCache method caches a type other than string or byte[] and no IHybridCacheSerializer<T> exists for it — HybridCache's default serializer throws on the first miss