ASP.NET Core 10 introduces native Server-Sent Events (SSE) support as a lightweight alternative to SignalR for one-way real-time updates. SSE uses standard HTTP with the text/event-stream content type, requires no client libraries, and supports automatic browser reconnection. The new Results.ServerSentEvents API works with IAsyncEnumerable to stream data, handles missed events via Last-Event-ID headers, and integrates seamlessly with existing authentication and authorization. SSE is ideal for dashboards, notifications, and progress bars where bidirectional communication isn't needed, while SignalR remains better for complex two-way scenarios.

6m read timeFrom milanjovanovic.tech
Post cover image
Table of contents
Why SSE Instead of SignalR?The Simplest Server-Sent Events EndpointHandling Missed EventsFiltering Server-Sent Events by UserConsuming Server-Sent Events in JavaScriptSummary

Sort: