Handling Cancellation in ASP.NET Core: From Browser to Database

Handling Cancellation in ASP.NET Core: From Browser to Database Ever clicked the stop button while waiting for a web page to load? What actually happens on the server when you do that? In ASP.NET Core apps, without proper cancellation handling, the server keeps working on requests nobody wants anymore. Your server might be burning CPU cycles and holding database connections open for users who have already given up and gone elsewhere. ...

June 22, 2025 · 7 min · 1319 words

Task vs ValueTask in C#: Making the Right Choice for Performance

Task vs ValueTask in C#: When to Choose Each One When writing async code in C#, most of us just use Task and Task<T> without thinking twice. But there’s this other option called ValueTask that can actually speed up your code in some situations. Let’s look at what makes these two different and how to pick the right one for your code. The Basics: Task and ValueTask Let’s start with what these two types actually are. ...

June 22, 2025 · 7 min · 1356 words