AJAX Made Easy - Learn AJAX



Home AJAX-Design
 

The Stateless Problem of Ajax

 

We are often dazzled with websites that were developed with Ajax. The interface is amazing and the interaction with users is simply beyond expectations. The asynchronous streaming of information from the server gives the user the ability to update the information in our browsers without refreshing the entire webpage. This update in web experience has truly launched Ajax’s role in web development.


However this update in web experience comes with a great price. Simple webpages, such as those developed as HTML could be bookmarked and saved so that the information will still be available offline. Users can also conveniently press the “back” button on their browser in case they want to undo some operations in the website.


For example, I want to change something in my cart before I check out. Instead of doing the process again, I just have to press the back button until I reach that page where I can customize my order. Unfortunately, these features are not available for Ajax. The reason for this is that Ajax relies on the application server to load the information. What the users see in the browsers is actually information that is stored in the server and not cached within the browser and stored in the user’s computer for fast reference in case the user opted to use the back button. The offline capability of Ajax based websites is not just there.


Fortunately, there are some frameworks available today that have somehow addressed this problem. The solution they have posted in back, bookmark and save functions is to load the data as cached information. It is an easy solution with dangerous disadvantages. Without proper control, data will just continue to stream information that should be cached which will eventually slow down bandwidth and even stop the internet connection altogether.


Another solution posted by some frameworks especially those that are Java based frameworks is to cache the data and the small part of the application. By streaming a particular part of the application, users can work with the system offline. This actually works but when you save the webpage and e-mail them, the system will no longer work. The particular part of the application is loaded to the user’s computer through cache. Since other users did not have the same cached data, the information will not stream as expected.


That is why it is important for developers to think of creative solutions to address this stateless problem of Ajax. A simple solution was to actually tag the page occasionally so that data that was saved during that particular tagging will be retrieved when they are retrieved. Another solution is to place tagging commands in each webpage. Commands such as “save this” or “print this” could be embedded in every page so that users can easily save the information since the server is informed that an action is actually being done. However, this is too tedious as various versions of webpage could come up.


Again, this goes to show that Ajax has a long way to go before we could actually live with this technique. Unless we can change our behavior about our browsing experience, developers have to think of smarter ways to address the stateless problem of Ajax.



Read Next: Ajax Uncaught Exception Error



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links