简体   繁体   English

当您收到新邮件时,gmail的“自动刷新”功能是什么?

[英]What's the tech behind gmail's “autorefresh” when you get new mail?

What technology is Google using (and many other people, eg Apple's iCloud webmail client) to automatically update the UI when a new email is received? Google会使用什么技术(以及许多其他人,例如Apple的iCloud Webmail客户端)在收到新电子邮件时自动更新UI?

EDIT : I should say that I am asking this from the perspective of building an extremely high concurrency app, so it will need to scale well. 编辑 :我应该说,我是从构建一个极高的并发应用程序的角度来问这个问题,因此它需要很好地扩展。 Think online IM client/chatroom. 考虑在线IM客户端/聊天室。

It's called HTTP Server Push . 这称为HTTP Server Push Instead of continuously polling the server to check for new mail, the server HTTP server pushes the data to the web browser. 服务器HTTP服务器将数据推送到Web浏览器,而不是连续轮询服务器以检查是否有新邮件。 HTTP server push can be achieved through several mechanisms, including long ajax polling, Comet and Web Sockets. HTTP服务器推送可以通过多种机制来实现,包括长ajax轮询,Comet和Web套接字。

他们使用AJAXCometWebSockets

they are using ajax for querying data from it's backend in some regular interval. 他们使用ajax定期地从后端查询数据。 and for realtime Notification they use COMET for realtime data retrieval from the backend. 对于实时通知,他们使用COMET从后端进行实时数据检索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM