Gmail 是否使用 setInterval() 或 setTimeOut() 进行定期刷新? [英] Does Gmail use setInterval() or setTimeOut() to do periodical refresh?

查看:25
本文介绍了Gmail 是否使用 setInterval() 或 setTimeOut() 进行定期刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我猜他们使用这两个函数对他们的服务器进行 Ajax 调用,但我不确定.他们是怎么做到的?

I guess they use these two functions to make an Ajax call to their server but I am not sure. How do they do that?

谢谢.

推荐答案

我没有尝试对 Gmail 进行逆向工程,但很可能他们正在使用某种形式的 彗星(反向 AJAX).

I haven't tried to reverse-engineer Gmail, but most likely they are using some form of Comet (reverse AJAX).

通过这种方法,信息可以立即获得,没有任何延迟和额外的网络流量.

With this approach information is available instantly without any delay and additional network traffic.

这篇关于Gmail 是否使用 setInterval() 或 setTimeOut() 进行定期刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆