NET 10 Server-Sent Events Can Replace SignalR for One-Way Progress Feeds
A developer testing a code-review suggestion found that ASP.NET Core's minimal APIs already stream JSON arrays incrementally via IAsyncEnumerable, contradicting the long-held belief that JSON responses always buffer until completion. The confusion stemmed from browser behavior: fetch().json() waits for the full response body, making it appear the server was buffering when it was not. With .NET 10, the TypedResults.ServerSentEvents API offers a cleaner solution for browser-facing progress feeds, requiring no additional packages, hubs, or negotiation handshakes. SSE carries roughly 60% more framing overhead than plain JSON on tiny payloads, but the difference is negligible at real-world sizes. The author concludes that SSE should be the default for one-way browser feeds in .NET 10, with SignalR reserved for scenarios requiring bidirectional messaging, fan-out, or a backplane.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in