作者:醉苏芳华 | 来源:互联网 | 2023-05-18 19:08
IwaslookingatthingslikeGooglerealtimesearch(notgoogleinstant)andfacebookchatforexamp
I was looking at things like Google realtime search (not google instant) and facebook chat for example. They have data constantly coming up but at unpredictable intervals. However, it always seems to come up almost instantly.
我正在查看Google实时搜索(不是谷歌即时)和Facebook聊天等内容。他们的数据不断出现,但间隔时间不可预测。然而,它似乎总是几乎立即出现。
I've implemented something like this at http://malachy.org.uk/stream, however the way I've done it is by having an XHR check for updates every couple of seconds, which I guess is a bit inefficient, and anyway while checking the net requests log in firebug on google realtime for example I don't see XHRs coming up at nearly the rate of new posts (well on trendy topics anyway).
我已经在http://malachy.org.uk/stream上实现了类似的功能,但是我这样做的方法是每隔几秒检查一次XHR更新,我猜这有点效率低,而且无论如何,在谷歌实时检查网络请求登录firebug时,我看不到XHR几乎以新帖子的速度出现(反正时尚话题)。
Any idea how this is done?
知道怎么做的吗?
Cheers
干杯
1 个解决方案