简体   繁体   中英

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?

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.

It's called 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 server push can be achieved through several mechanisms, including long ajax polling, Comet and Web Sockets.

他们使用AJAXCometWebSockets

they are using ajax for querying data from it's backend in some regular interval. and for realtime Notification they use COMET for realtime data retrieval from the backend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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