开发者

How does google update their google finance graphs?

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 G开发者_高级运维ETs 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜