谷歌如何更新他们的谷歌财经图表?
我正在查看股票/指数:
http://www.google.com/finance?q =google
我在 firefox 中打开了 firebug,当页面上的价格更新时,我没有看到任何 GET 或 POST,仅在 30 到 60 秒后看到一次 get。
当然,如果页面正在更新一个值,Firebug 不会在发生时显示此数据到达页面吗?还是firebug批量收集连接?
i'm looking at a stock/index:
http://www.google.com/finance?q=google
I've got firebug open, in firefox and when the price updates on the page, i dont see any GETs or POSTs, just a get maybe 30 to 60 seconds later.
Surely if the page is being updated with a value, wouldnt firebug show this data reaching the page as it happens? Or does firebug collect connections in batches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
进一步查看 GET 连接日志,查看是否存在已打开但未关闭的连接。该页面可能正在打开与数据服务器的 XmlHttpRequest 连接并无限期地保持该连接打开。这对于流数据情况很常见,即使数据流的容量相当小。如果是这种情况,则新数据将到达打开的连接,日志中不会报告任何新连接活动。
Look further back in the GET connection logs to see if there is a connection that was opened but not closed. It's likely that the page is opening an XmlHttpRequest connection to the data server and keeping the connection open indefinitely. This is common for streaming data situations, even when the data stream is fairly low volume. If this is the case, then new data will arrive on the open connection without any new connection activity reported in the log.
有一个请求永远不会完成响应(或者至少在我观看的时候没有),您可以在 NET 面板中看到这一点,该响应定期输出更多数据,然后用于更新应用程序。如果您检查请求,您将看到它指定了一个标头 Transfer-Encoding: Chunked,该标头用于这些目的,请参阅 http://en.wikipedia.org/wiki/Chunked_transfer_encoding。
There is one request that never finishes responding (or at least not for the time I watched), you can see this in the NET panel, this response periodically outputs more data which is then used to update the application. If you examine the request you will see that it specifies a header Transfer-Encoding: Chunked, which is used for these purposes, see http://en.wikipedia.org/wiki/Chunked_transfer_encoding.