Troubleshooting — EricksonLopez.Caching
L2StableNuGet: v1.0.0Local HEAD: v2.0.0AOT: Full
Common operational pitfalls when configuring EricksonLopez.Caching (1.0.0).
- Symptom: Memory usage climbs steadily under high key cardinality.
- Cause:
MemoryCacheOptions.MaxCapacitydefaults tonull(unbounded). - Fix: Always configure a finite
MaxCapacityinAddMemoryCacheProvider(opt => opt.MaxCapacity = 50_000).
RemoveByPrefixAsync("") Throws ArgumentException
Section titled “RemoveByPrefixAsync("") Throws ArgumentException”- Symptom: Calling
RemoveByPrefixAsync("")or whitespace throwsArgumentException(ArgumentException.ThrowIfNullOrWhiteSpace). - Fix: Always pass a non-empty key prefix, or use explicit
RemoveByTagAsync/RemoveAsync.
- Symptom:
NotSupportedExceptionor missing type metadata during Native AOT serialization. - Fix: Pass a
[JsonSerializable]-backedJsonSerializerOptionsinstance toSystemTextJsonCacheSerializerinstead ofSystemTextJsonCacheSerializer.Default.