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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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)