
Handling Request Cancellation in ASP.NET Core: From Browser to Database
TL;DR: ASP.NET Core cancels requests when the client disconnects or times out. Use HttpContext.RequestAborted and pass it through to services and EF Core/database calls. Proper cancellation avoids wasted CPU, memory leaks, and long-running queries. Always propagate the cancellation token from controller to database for graceful shutdown. Ever clicked the stop button while waiting for a web page to load? What actually happens on the server when you do that? ...