ajax - JS: auto updates without multiple XHRs -


i looking @ things google realtime search (not google instant) , facebook chat example. have data coming @ unpredictable intervals. however, seems come instantly.

i've implemented @ http://malachy.org.uk/stream, way i've done having xhr check updates every couple of seconds, guess bit inefficient, , anyway while checking net requests log in firebug on google realtime example don't see xhrs coming @ rate of new posts (well on trendy topics anyway).

any idea how done?

cheers

look at:

because http protocol (being used ajax) typical request/response protocol, there no easy way achieve this. reverse ajax uses few clever techniques long-polling whether websockets brand new technology somewhere around html5, addressing problem (yet not established , implemented).

your solution (asking server every few seconds) simplest one, introduces both high volume of networks calls , unacceptable latency.


Comments