8 minutes ago · 6 min read1137 words · Tech · hide

Imagine opening a dashboard that generates a fairly detailed analytics report. You click a button, the application starts fetching data from a couple of APIs, and then you realise you don’t need the report anymore. So, you close the tab and move on. From your (user’s) perspective, the operation is over. But on the server, things might be very different. It could still be making API calls, running database queries, or an expensive operation such as waiting for an AI model to generate a response. All of that work might continue even though there’s nobody waiting for the result anymore. This is one of those small problems in web development that often goes unnoticed. We spend a lot of time making requests faster, but we don’t always think about what happens when someone no longer needs a request to finish. Anyway, this is where request cancellation becomes interesting. Cancelling a request is only half the story JavaScript has had a fairly straightforward way of cancelling asynchronous…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town