Comet vs Ajax for chatting

痴心易碎 提交于 2019-12-24 00:41:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!