Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
What's New in Caching with .NET 11: MemoryCache Metrics, HybridCache Factory Context and IOutputCachePolicyProvider
.NET 11 brings three caching changes: with TrackStatistics on, MemoryCache publishes dotnet.cache.requests, evictions, entries and estimated_size metrics on its own; the HybridCache factory can choose the duration from the value; and IOutputCachePolicyProvider resolves output cache policies at runtime. The catch we measured: with today's package the new HybridCache overload isn't atomic (40 factory runs instead of 20 for 20 cold keys), and a custom provider silently drops AddPolicy definitions.
ASP.NET Core Output Cache in Depth: Policies, Vary-By, Tag Eviction, Resource Locking and the Redis Store
Policies, vary-by rules and middleware order decide whether output cache is safe and effective: in Bookstore, resource locking ran the handler once for 100 concurrent requests (100 times with locking off), and placing UseOutputCache before authentication served Ada's personal recommendations to an anonymous user and to Grace on the 10.0.3 runtime. The Redis store gives two instances a shared cache and eviction, while locking stays per instance.