Engineering Decisions · Middle · Question 5 of 14
A sports site pushes live scores to browsers. Data flows only from the server, traffic passes through regular HTTP proxies, and reconnects must be simple. What fits?
- 1Short polling every two seconds
- 2WebSockets with a heartbeat protocol
- 3Server-Sent Events over plain HTTP
Show the answer
Correct answer: Server-Sent Events over plain HTTP
Explanation
Server-Sent Events are made for one-way streams, run over ordinary HTTP and reconnect automatically. WebSockets fit two-way traffic like chat or games, but here they add a protocol and reconnection logic for a direction nobody uses. Short polling fits rare updates, whereas every two seconds it means a lot of empty requests at this scale.