Rainer Stropek
Leveraging Server-Sent Events (SSE) for Efficient Data Streaming in UI Development
#1about 6 minutes
The core problem of long-running HTTP requests
A simple demo illustrates poor user experience when a backend operation takes several seconds to complete, leaving the UI unresponsive.
#2about 6 minutes
Manually streaming data with HTTP chunks
Learn how to send partial responses from a Node.js server using `response.write` and process them on the client with `ReadableStream` and `TextDecoder`.
#3about 7 minutes
Introducing the Server-Sent Events protocol
The SSE protocol simplifies streaming by using a `data:` prefix and the browser's built-in `EventSource` API, which also handles automatic retries.
#4about 4 minutes
Using named events for structured messages
The SSE protocol supports sending named events using the `event:` key, allowing for more structured communication handled by specific event listeners on the client.
#5about 5 minutes
Ensuring reliable delivery with message IDs
Implement robust streaming by using the `id:` field in SSE messages, which enables the client to automatically send a `Last-Event-ID` header upon reconnecting.
#6about 7 minutes
Why SSE is relevant again because of OpenAI
OpenAI's streaming API uses Server-Sent Events extensively, leading to a resurgence of the technology for building real-time AI applications.
#7about 6 minutes
Building a streaming client for the OpenAI API
A practical demo shows how to use the OpenAI SDK, which abstracts SSE into a `for await` loop, and then stream the results from your server to the client using SSE.
#8about 12 minutes
Q&A on SSE implementation and best practices
Discussion covers topics like connection timeouts, keep-alive messages, server scalability for many connections, and use cases beyond text streaming.
Related jobs
Jobs that call for the skills explored in this talk.
Hubert Burda Media
München, Germany
€80-95K
Intermediate
Senior
JavaScript
Node.js
+1
Matching moments
04:57 MIN
Increasing the value of talk recordings post-event
Cat Herding with Lions and Tigers - Christian Heilmann
11:10 MIN
The only frontend stack that truly matters
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
11:32 MIN
The industry's focus on frameworks over web fundamentals
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
06:44 MIN
Using Chrome's built-in AI for on-device features
Devs vs. Marketers, COBOL and Copilot, Make Live Coding Easy and more - The Best of LIVE 2025 - Part 3
04:02 MIN
How a broken frontend culture impacts the web
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
02:39 MIN
Establishing a single source of truth for all data
Cat Herding with Lions and Tigers - Christian Heilmann
04:49 MIN
Using content channels to build an event community
Cat Herding with Lions and Tigers - Christian Heilmann
Featured Partners
Related Videos
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
Ahmed Megahd
Develop AI-powered Applications with OpenAI Embeddings and Azure Search
Rainer Stropek
Uncharted Territories of Web Performance - Andrew Burnett-Thompson and David Burleigh
Andrew Burnett-Thompson & David Burleigh
Snappy UI needs no Single-Page Application
Clemens Helm
Wasm Deep Dive - A Glance Behind the Scenes
Rainer Stropek
Server Side Serverless in Swift
Sebastien Stormacq
Build UIs that learn - Discover the powerful combination of UI and AI
Eliran Natan
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Visonum GmbH
Remote
Junior
Intermediate
React
Redux
TypeScript

ROSEN Technology and Research Center GmbH
Osnabrück, Germany
Senior
React
DevOps
Next.js
TypeScript
Cloud (AWS/Google/Azure)

Almedia
Berlin, Germany
€85-100K
Senior
NestJS
Node.js
Express
TypeScript
+1

Client Server
Esher, United Kingdom
Remote
£85-100K
Redis
React
Kafka
+7

Client Server
Sunderland, United Kingdom
Remote
£70K
React
.NET Core
JavaScript
+2

Client Server
Leeds, United Kingdom
Remote
£100K
Redis
React
Kafka
+7

Client Server
Charing Cross, United Kingdom
Remote
£100-130K
C++
Java
Elixir
+1

Client Server
Luton, United Kingdom
Remote
£100K
Redis
React
Kafka
+7
