Ajax Technology – Understanding the Polling and Bookmarking Problem

ab6887f841271aecaad171c37ef2c6fc_002

A thread is created for each client request. After the HTTP request has been processed, resources that were occupied by the request are immediately released .

Since web servers are not in a position to forward asynchronous events to an Ajax client if they did not request this, the Ajax client must itself permanently send requests to the Web server (the actual polling), if a new event has been created or a change has occurred in the application state.

This produces a very different load on a Web server, as compared to the load generated from conventional applications. To prevent an ongoing polling, a polling technique was developed, while retaining poll responses to an actual event or a time out.

However, this technology raises new problems. Previously, it was common for each request to the server to create a thread whose resources could be released immediately after processing the request.

In the above described polling technique, however, such release of resources is not possible. This leaves further problems on resources such as memory usage. This problem poses new challenges to the scalability of an Ajax application. A possible solution to this problem is to use an application server that supports the principle of continuation.

Bookmark

A similar problem is the fact that it is almost impossible for websites that are updated dynamically to set a bookmark to a particular state of a Web application.

Most often, the anchor in the current URL is used in this context, which is after the hash (#). In this way, it is possible to monitor the process flow of an application. It also allows the user to restore a particular application state of said URL.

Many web browsers allow you to update the anchor dynamically through JavaScript. This allows an Ajax application to update the page content shown in parallel for processing. These approaches also fix some of the problems caused by the non-functioning back button.

Feedback

The latency period, ie the time interval between an HTTP request from the browser and the associated server response must be considered when developing an Ajax application.

Without a clearly visible feedback to the user, predictive loading of individual application data and a correct handling of the XMLHttpRequest object may impose the impression that the entire application will only respond seamlessly to user actions.

For this reason, it is important to use the visual feedback, such as the symbol of an hourglass to make the user aware that certain background activities are currently taking place.

About the Author