I'm building a real-time web application As far as I know, the most popular choices are short-polling and long-polling. What are the advantages and disadvantages might there be for measuring one over the other?
Short polling (a.k.a. AJAX based timer):
Pros: simpler, not server consuming (if the time between requests is long).
Cons: bad if you need to be notified WHEN the server event happens with no delay.
Example (ItsNat based)
Long polling (a.k.a. Comet based on XHR)
Pros: you are notified WHEN the server event happens with no delay. Cons: more complex and more server resources used. Example (ItsNat based)