A browser that polls has to guess when news will arrive, so it either asks too often or hears too late; a WebSocket lets the server send news the moment it exists.
Learn the idea first
Your phone shows 120/2. In the next 30 seconds there is a four, a wicket and a six. Compare three ways of keeping the screen up to date. In the time bar, Screen out of date is time a new score sat on the server while your screen still showed the old one. Timings are an illustrative model.
Your phone
score page open
App server
scores.example
Score feed
at the ground
Swipe the diagram sideways to see every column →
Where the time goes
30738 ms total
Your phone shows 120/2. In the next 30 seconds there is a four, a wicket and a six. Compare three ways of keeping the screen up to date. In the time bar, Screen out of date is time a new score sat on the server while your screen still showed the old one. Timings are an illustrative model.
Illustrative timings. Real numbers vary with distance, network quality and server load.