Gene Moy (梅忠毅) is a user experience architect from Chicago with 15 years experience working on the web and now, medical devices. Occasionally he thinks every day feels like 1995 all over again. More about Gene »
To sum it up, AJAX is dependent on a kind of client-side data request method called polling. The browser opens a connection and constantly asks the server at a fixed interval, “do you have updates for this data?” To which the server is forced to reply, “yes, here it is” or “no” and closes the connection.
There are other types of request handling techniques using an architecture called Comet, which drives data down to the client from server events. The browser need only ask once, and the server will do the rest. That’s the theory anyway.
One is a revival of the old 90s push technique, but using AJAX, called streaming, so that now when the browser — or 10,000 browsers — open a single persistent connection and asks, “Do you have updates?” the server can just park the request until there are updates and then push that data to the browser, but instead of closing the connection, they keep the connection open and reuse it.
Then there is the long-polling technique, which if your server supports asynchronous request processing (as Tomcat does) optimizes the original polling technique, in which a browser request is kept open until the server has an update to provide or until it times out, then pushes it to the browser and closes the connection. The browser immediately opens the connection again, and the cycle starts again.
Permanent link to AJAX polling techniques
Filed under Technology
RSS feed for comments on this post. TrackBack URL
No responses yet.
Fire your weapon, soldier. Just be careful of friendly fire. NAME & EMAIL required.
Proudly powered by WordPress 3.1.4. RSS Feeds for Entries and Comments.
Everything is design is licensed under a
Creative Commons Attribution-Noncommercial 3.0 License.
Bad Behavior has blocked 569 access attempts in the last 7 days.