AJAX Polling Frequency - To long poll or not to long poll? AJAX Polling Frequency - To long poll or not to long poll? ajax ajax

AJAX Polling Frequency - To long poll or not to long poll?


Long polling will scale better (i.e. less server load) than polling, while giving much better response times.

If your recipient polls, the average journey time of a message will be half your poll interval.

With long polling, its instant - the server only waits if there is nothing to say.

If you are doing chat messaging, go long poll; its a usability thing.

The down-side with long polling is it is more complicated to implement; but its not that much more complicated, and it is widely implemented. So if you can't use an off-the-shelf framework for your webserver of choice, you can set about writing one reasonably and you will get it working.


You can also look at websockets, part of the newest browsers (or emulated via a Flash file you drop on your page)