问题
My site needs a chat room, and I'm also looking to implement a facebookesque person to person chat system.
What is most cost-efficient/performant (purely in terms of bw and server) for me. A regular 1 second poll ajax chat, or a comet solution.
Thanks.
回答1:
Comet would typically result in lower bandwidth usage (assuming less than 1 chat message per second per chat on average), owing to the fact that it will only query the server once per message sent. It would typically result in more concurrent active connections to your server though.
This blog article may help you visualise it better.
来源:https://stackoverflow.com/questions/2182052/comet-vs-ajax-for-chatting