In what situations would AJAX long/short polling be preferred over HTML5 WebSockets?

前端 未结 4 1143
太阳男子
太阳男子 2020-11-22 01:15

I am building a small chat application for friends, but unsure about how to get information in a timely manner that is not as manual or as rudimentary as forcing a page refr

4条回答
  •  眼角桃花
    2020-11-22 01:53

    One contending technology you've omitted is Server-Sent Events / Event Source. What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet? has a good discussion of all of these. Keep in mind that some of these are easier than others to integrate with on the server side.

提交回复
热议问题