AJAX Made Easy - Learn AJAX

AJAX Categories

 

Latest AJAX Articles

AJAX Home AJAX-Tips

Optimizing the Server Side of Ajax

Author: admin | Published: 3rd May 2008 | Read: 178 times | Add Comment
Filed in: AJAX Tips



The server side of Ajax is often overlooked since there is virtually nothing going on there except that it streams information to the client side. Much of the action in the development of an Ajax based application is in the client side and unfortunately, the server side is often ignored because it is just there – streaming information to the client.


But when you reconsider the function of the server-side, you will realize the server has a very big role when the application is already online. When properly coded, the speed of the application is not just on the client side of the application. The burden is even placed on the server side as it has all the information of the application. If the server is not properly coded, the application will be for nothing. Server-side is all about speed and with faster processing time becoming more and more the benchmark of any online application, the server-side became the battle ground for developers. The client side is not yet exhausted but the server-side has not been given a serious thought by the developers.


Since it is asynchronous, developers opens up the connection from the server to the client side. There are two scenarios that can happen there in relation to the client side functions: first, developers can rely on user interaction and with that set a response from the server. It is simple and lightweight but it does not offer enough interaction. The second scenario is to continuously push the server to stream the information in a continuous manner. This eliminates the need of user interaction.


However, what if you need a little bit of both? For example you wanted to have a streaming drag and drop application in your website. The server side has to continuously connect to the browser however it has to have the interactivity needed from the user at the same time.


That seems to be a very challenging task but there is actually a very simple trick that should be able to handle that scenario. It all boils down to the ability of the server to cache the information and throws it back to the client to continue the browser’s ability to stream. But the server does not have to cache the information permanently as it will hoard all the information and cripple the browser. Instead, it will temporarily cache the information and cut it off as soon as it is thrown to the server side.


How do you do that? By cutting off the client side communication altogether. Since the server is still streaming the information to the client side, you have to forcibly cut the communication just to eliminate the temporary stored files. Even though the connection is closed, the client side will still function as expected when they are coded correctly. Until another command from the user, the server side will remain in the background.


This simple trick in Ajax server side gives the developers more power in terms of streaming information to the user while accepting inputs from the user. The end product is a powerful website without the dragging bandwidth requirement of the server push.






Next: Some DOM Tricks to Your Website



Post Comment


You need to Login to post your comment...

Click here to login

Title:
 
Comment:



Daily Email Updates

AJAX Updates delivered directly to your Inbox...

Enter your email address:

Latest AJAXwith Updates
 

Related AJAX Articles

 » Degradable Ajax
 » Reducing Code Size of Ajax Applications
 » Google Hosting Ajax Libraries
 » Three Powerful Profilers for Ajax
 » Preventing Latency in Client Side
 » Optimizing Files for Ajax
 » AFLAX - A Lightweight Ajax Framework with Flash
 » Porting MySQL Data to Ajax
 » Debug your Ajax Application Easily
 » Ajax and Iphone 2.0

Popular AJAX Articles