Understanding Ajax

People don't understand how Ajax works. Generally, they think that Ajax has finally fixed the problem of the World Wide Wait scenario. Wrong! Totally wrong! Because either you post something or you get something through Ajax, you have to wait until your request has been processed by the server if you want to get a response. For example, when you click on a "Like" link on Facebook, your GET request is passed to a PHP script that:

  1. extracts all URL parameters
  2. processes those parameters
  3. returns a response that JavaScript can handle

So if the server is busy, you have to wait. You've probably noticed that sometimes your browser hangs on Facebook. That's exactly what I mean: you have to wait until the server has freed some of its resources to complete your request processing. This is something that you cannot fix with some Ajax/JavaScript workarounds : you have to work on the server-side aspect of the problem. I hope that people will bear this in mind while developing their RIA (Rich Internet Applications) with Ajax.

Leave a Reply

Note: Only a member of this blog may post a comment.