Pick the fix
A stock ticker page needs server-to-browser price updates once a second; no client messages. Best fit?
Hint 1 of 1
Which way does data flow?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Server-sent events
Correct. One-way stream over HTTP with built-in reconnect and resume.
Server-sent events are a plain HTTP response that stays open and streams events one way. The browser's EventSource reconnects on its own and sends Last-Event-ID to resume, which is all a ticker needs.
Why not the others?
- B WebSockets. Works, but adds a two-way protocol you don't need.
- C Polling every 100 ms. Ten times the requests for one update a second.
- D Webhooks. Webhooks call servers, not browsers.