IOptionsSnapshot: The Snapshot Your Singleton Froze
IOptionsSnapshot is scoped. Inject it into a singleton and Production will not throw. You get one snapshot, minted at first resolve, that ignores every reload.
Theme
System design, modern web development with Next.js, React, .NET, Azure, and practical coding guides.
26 articles
IOptionsSnapshot is scoped. Inject it into a singleton and Production will not throw. You get one snapshot, minted at first resolve, that ignores every reload.
Cookie auth, antiforgery, and TempData encrypt with the Data Protection key ring. The default ring is local. A second instance, a slot swap, or a recycled container mints a ring the first one never had.
after() is not a request API. On a static page the callback runs at build or revalidate. Read cookies before the callback, and do not treat it as a job queue.
ExecuteUpdate sends SQL now. It skips SaveChanges, the tracker, and your audit interceptor. Stamp columns in the SET, or the tracked entity lies.
use() reads a Promise or Context. Creating the Promise in render suspends forever. Lift it, wrap Suspense, and catch rejections with an Error Boundary.
middleware.ts is deprecated. The export must be named proxy, the runtime is Node and cannot be set, and a matcher that skips a page also skips its Server Actions.
ASP.NET Core binds CancellationToken to the aborted request. Forward it to EF Core and HttpClient, and do not turn a client disconnect into a 500.
How Cache Components in Next.js 16 replace route segment configs with the use cache directive and cacheLife, what becomes a build error, and the cookies-outside-the-cache rule that trips every migration.
TypeScript 7.0 is the native Go compiler, stable since July 2026, with 8 to 12x faster full builds. Deprecations are hard errors, strict and esnext are defaults, and the programmatic API waits for 7.1. A migration order that keeps lint and frameworks working.
Why new HttpClient() in a .NET service exhausts sockets under load, and how IHttpClientFactory plus a named client fixes DNS without freezing the handler forever.
Why key={index} corrupts state when a list is filtered, sorted, or prepended, and which id to use instead.
How to wire useOptimistic with Actions so toggles and comments feel native, roll back on failure, and stay consistent when two mutations overlap.