Thursday, February 15, 2007

HTTP Streaming - interesting alternative to polling

Triggered by a question that came up about how to create a web page that shows data dynamically without user interaction (like a stock ticker, weather conditions etc.), I came across this post that explains HTTP Streaming.
The obvious answer would be to do "polling" having some Javascript timer on the page that makes a periodic XMLHTTPRequest to get data back to the page.
HTTP Streaming is an interesting alternative.
It is also interesting that apparently IE does not send the response to an XMLHTTPRequest back unless the request is complete, so the article also describes a clever way around that.
The main drawbacks I can see are bandwidth and the required resources on the server, basically one open connection (or thread) per connected client.

No comments: