#617 – July 19, 2026
cache stampedes happen when many requests all miss the cache at the same moment
Cache stampede: When our cache turned against us
4 minutes by Bart Wullems
Cache stampedes happen when many requests all miss the cache at the same moment and hit the database together. A simple fix is adding a per-key lock using SemaphoreSlim, so only one request rebuilds the cache while others wait and reuse the result. ASP.NET Core's built-in HybridCache handles this automatically. Adding random jitter to expiry times also helps prevent many keys from expiring all at once.
How one team cut agent deployment time from 3 months to 1 week
sponsored by LangChain
Agents are non-deterministic, stateful, and dependent on models and tools that change without warning, so traditional engineering playbooks don't translate. LangChain's new guide, the Agentic Operating Model, shows how one enterprise team went from 3-month agent rollouts to production in a week by aligning people, process, and technology. Get the guide.
Role-based authorization in ASP.NET Core
12 minutes by Mukesh Murugan
Roles in JWTs are just claims with an agreed name. Mukesh suggests to write role claims at login, set RoleClaimType to match, then protect endpoints with RequireRole or the Authorize attribute. A common silent bug occurs when claim mapping renames your role claim to a long URI, causing every role check to return 403 with no error. Multiple roles in one call mean OR, while chained calls mean AND, and repeated checks belong in a named policy.
Redesigning the NServiceBus pipeline yet again
8 minutes by David Boike, Daniel Marbach
The NServiceBus message pipeline was redesigned to support modern .NET trimming and ahead-of-time compilation, which ban the dynamic code generation the old approach relied on. The solution uses default interface members to build a statically typed chain where each behavior wires directly to the next at startup. The result is a pipeline that starts 330 times faster, runs 25 to 29% faster on the success path, and existing custom behaviors require no changes to benefit.
ASP.NET Core background tasks with NCronJob and SignalR
4 minutes by Damien Bod
NCronJob is an open source NuGet package for running background jobs in ASP.NET Core. It works by implementing a simple IJob interface and supports both concurrent and non-concurrent job execution. In this demo Damien uses it to send messages every five seconds through SignalR, displaying them in a Razor Pages UI.
Discriminated unions in C# and .NET 11 (for real this time)
6 minutes by Maarten Balliauw
C# 15 adds native union types, letting you declare that a value is exactly one of several types in a single line. The compiler handles implicit conversions and, most usefully, enforces exhaustive pattern matching, so missing a case in a switch expression raises a warning. This removes the need for workarounds like the OneOf package or hand-rolled implicit operators.
And the most popular article from the last issue was: