Middleware order is important

Place ASP.NET Core middleware in the order that matches routing, security, and endpoint behavior.

July 5, 2026 · 2 min · 265 words

Pass CancellationToken through real boundaries

Thread cancellation through every expensive operation instead of dropping it mid-chain.

July 5, 2026 · 2 min · 290 words

Prefer health checks that test dependencies deliberately

Health checks should say something useful about readiness without turning every probe into production load.

July 5, 2026 · 2 min · 274 words

Use HybridCache when cache stampedes matter

Use HybridCache for expensive shared lookups where many callers can miss at once.

July 5, 2026 · 2 min · 230 words

Use ProblemDetails as your API error contract

Return one predictable error shape instead of inventing a new JSON format for every failure.

July 5, 2026 · 1 min · 207 words