问题描述
所有 HTTP 响应都需要客户端启动它们,即使是使用 AJAX 做出的响应.但是 GMail 的聊天功能能够接收来自其他用户的消息,即使我只是坐在舒适的电脑椅上观看但不与浏览器交互.他们是怎么做到的?
All HTTP responses require the client to initiate them, even those made using AJAX. But GMail's chat feature is able to receive messages from other users, even when I'm just sitting in my comfy computer chair watching but not interacting with the browser. How did they do it?
推荐答案
这种技术被称为彗星",也被称为服务器推送"、反向ajax"等.
That tech is known as "comet", but also as "server push", "reverse ajax", etc.
这是关于将数据从服务器推送到浏览器,保持 http 连接处于活动状态.在 维基百科文章 (英文版).
It's about pushing data from the server to the browser, keeping an http connection alive. Find more info on it on the wikipedia article (English version).
这里还有一个 相当不错的演示文稿,来自 DWR 的 Joe Walker,他在哪里谈论彗星.
Also here's a pretty good presentation with Joe Walker from DWR, where he talks about comet.
这篇关于GMail Chat 如何能够在没有客户端交互的情况下发出 AJAX 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)