Skip to main content
π Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial β
β‘
β Courses
βΊ
FastAPI Production
βΊ
Module 5 Β· Production Deployment & Observability
βΊ
SSE and streaming responses
quiz
69 / 105
πΊπΈ
EN
βΌ
β
Share
β―
More
+100 XP
π
Task
π
Theory
π€
AI Help
Task
π **Question:** Why send keepalive lines on an SSE stream? π Pick the right answer. π‘ **Hint:** Re-read the theory above if unsure.
π― Quiz
Question
π **Question:** Why send keepalive lines on an SSE stream? π Pick the right answer. π‘ **Hint:** Re-read the theory above if unsure.
A
Browsers require a comment line at least every 30 seconds or they will close the EventSource connection with a network error, so the comment is purely a client-side compatibility requirement
B
Proxies (nginx, ALB, Cloudflare) close idle HTTP connections after 30-60s of silence
C
The SSE specification mandates a colon-prefixed line as the wire-level heartbeat β without it, conforming clients refuse to dispatch any events at all to the application layer above the parser
D
It exists only to make traffic visible during debugging β without periodic comments you can't tell whether the stream is healthy or just quiet, but production code can safely omit it entirely
Submit answer
π¬
Message support