EricksonLopez.Caching Overview
L2StableNuGet: v1.0.0Local HEAD: v2.0.0AOT: Full
EricksonLopez.Caching (1.0.0 on NuGet, L2) provides composable L1 in-memory, L2 Redis, hybrid, and tenant-partitioned caching integrated directly with EricksonLopez.Result.
- Explicit outcome semantics:
ICacheProvideroperations returnTask<Result<T>>/Task<Result<bool>>rather than conflating cache misses with backend transport failures. - Single-flight stampede protection:
GetOrCreateAsynccoordinates concurrent factory calls per key so downstream databases are not overwhelmed on cold or expired keys. - Fail-safe stale serving:
FailSafeMaxStaleserves stale values when factory execution fails transiently (HybridCacheProviderandMemoryCacheProvider). - Tag & prefix invalidation:
ITaggedCacheProvidersupportsRemoveByTagAsyncandRemoveByTagsAsyncalongsideRemoveByPrefixAsync.
Rendering diagram…
flowchart LR Caller["Caller"] --> H["HybridCacheProvider"] H --> L1["L1 MemoryCacheProvider"] L1 -- Hit --> Caller L1 -- Miss --> L2["L2 RedisCacheProvider"] L2 -- Hit --> L1 L2 -- Miss --> F["Factory (Single-Flight)"] F --> L2
View accessible text summary and structure
Requests check the local MemoryCacheProvider first, fall back to RedisCacheProvider on L1 miss, and execute the factory under single-flight coordination on L2 miss.
flowchart LR
Caller["Caller"] --> H["HybridCacheProvider"]
H --> L1["L1 MemoryCacheProvider"]
L1 -- Hit --> Caller
L1 -- Miss --> L2["L2 RedisCacheProvider"]
L2 -- Hit --> L1
L2 -- Miss --> F["Factory (Single-Flight)"]
F --> L2Package Roster & Native AOT Status (2 / 2 Published)
Section titled “Package Roster & Native AOT Status (2 / 2 Published)”Both packages are published at 1.0.0 on NuGet (733 total downloads; localVersion: 2.0.0 unreleased on disk). Both target net8.0;net9.0;net10.0 and achieve Full AOT status (IsAotCompatible=true, EnableTrimAnalyzer=true):
| Package | NuGet (1.0.0) |
Local HEAD | AOT Status | TFMs | Role |
|---|---|---|---|---|---|
EricksonLopez.Caching |
Published (597 dl) |
2.0.0 |
Full |
net8.0;net9.0;net10.0 |
ICacheProvider, MemoryCacheProvider, HybridCacheProvider, TenantPartitionedCacheProvider, SystemTextJsonCacheSerializer |
EricksonLopez.Caching.Redis |
Published (136 dl) |
2.0.0 |
Full |
net8.0;net9.0;net10.0 |
RedisCacheProvider, RedisCacheOptions, AddRedisCaching |
Benchmark Status:
hasBenchmarks: false— zeroBenchmarkDotNet.Artifactsreports exist indotnet-caching, so no throughput or latency numbers are claimed here.