An interactive explainer
A normal web request is one question and one answer, and the server is never allowed to start. So a browser that wants news has to keep asking — and waste almost every ask. A WebSocket is one request that never ends: after it, either side can speak whenever it likes. That is why chat feels instant, and why ten thousand quiet connections still cost you four hundred megabytes.
WebSockets · Polling · Real-time messaging
Networking · Intermediate · 11 min · Why a chat message arrives instantly, and what holding the line costs — an interactive explainer on ViLearn, with a simulation and a knowledge check. All explainers.
Related: Why the video you are about to watch is already in your city · How two strangers get a secret past everyone in the room · How two strangers agree they can hear each other