Wednesday, June 11, 2008

Overview to Reverse Ajax

An introduction to Reverse Ajax Despite all the hype, Ajax cannot get real time information directly from the server. If some information arrives after the user has loaded a page they will never see it, unless they refresh the page. We could easily solve this problem in the traditional way, by having a having a little bit of Javascript in the webpage that automatically refreshes the page every few seconds. But refreshing an entire page every few seconds is overkill. If the millions of users of a large site were to refresh every few seconds it would increase the bandwidth dramatically. The effect on the servers would be similar to a DOS attack! We really just need the small piece of real time data to be updated on the browser as soon as it arrives in the server. The simplest way would be to have the server tell all the browsers that the data has been updated. But as we discussed in the introduction to Ajax, servers cannot initiate contact with browsers. Hence we need a solution which gets around this problem. Reverse Ajax allows servers to push content out to browsers immediately it becomes available