AJAX Polling vs. WebSockets Mobile Performance AJAX Polling vs. WebSockets Mobile Performance ajax ajax

AJAX Polling vs. WebSockets Mobile Performance


The answer is "it depends". If you're targeting a mobile device with a known good websockets implementation then go that way. At the moment, that's probably only iPhone/iPad with iOS4.2 or later which might have a good implementation.

For everyone else, you're going to be doing polling anyway, so I'd say go down that route.

I've done several near-real time services (<10s latency) that work fine using polling. I wouldn't use it for a chat engine, but for most everything else it's fine.


battery wise I don't think either will make a big difference. I would use socket.io though since you just use socket.io and it will try to use websockets and if the browser does not support them fall back to ajax requests