Resta saysPolling repeatedly asks for updates; long-polling and push reduce its waste.
Short polling hits the server on a timer ("anything new?") — simple but wasteful and laggy. Long polling holds the request open until there's data, cutting empty responses. Push (SSE/WebSockets) eliminates polling entirely. Reach for push when updates are frequent or latency matters; polling is fine for slow-changing data.
Power-ups you unlock
Short poll: timer requests (wasteful)
Long poll: hold open until data
Push (SSE/WS): no polling at all
Push when frequent/low-latency; poll when slow
The 401 Bandit attacks — common mistakes
Aggressive short polling hammering the server
Polling where push would be cheaper
Long polling without timeouts/limits
Boss battleRank short-poll, long-poll, and push by latency and server cost.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>short poll → many empty requests, laggy
long poll → hold until data, fewer requests
push (SSE/WS) → instant, no polling</pre></body></html>