The AJAX meme continues to percolate on the internet, with a nice summary article from QuirksBlog that links to some of the more interesting analysis. Geeks everywhere seem fascinated by the fact the XMLHttpRequest can be used to fetch data behind the scenes and serve it up when the user asks for it.
XMLHttpRequest is a handy and mildly interesting bit of plumbing. The fact that it’s a fairly simple API that you can read about and comment on makes it handy blog fodder. But the real differentiator in all of the new google applications is NOT in that they use XMLHttpRequest (they could easily use an iframes hack instead, as an earlier commenter on my site pointed out). They could even have used Flash!
The client-side predictive engine that google has built into their new applications is what really makes them powerful.
Let me explain. Gmail feels fast to users because it works behind the scenes to fetch the data you want before you request it (using XMLHttpRequest! Yay! Go AJAX!). This leads to a better user experience, because when you decide to open up a particular email message in gmail, the data is usually in RAM on your computer, instead of on a hard drive on a server somewhere.
But how did Google know that you were going to open that email, instead of a different one? Doesn’t anybody find it remarkable that google knows what you’re going to do before you yourself do?
First, lets clear the misconception that they’re doing something as simple as downloading ALL of the data. Gmail can’t download your entire email inbox because A) It would take too much time, and B) it would cost google too much bandwidth. In latency must die I described a simple economic model for deciding which data should be downloaded by an RIA: suffice it to say that downloading unused data gets expensive fast, especially for a web-scale application like gmail. So they aren’t doing that.
I have no doubt that the predictive engine in gmail is based on solid user metrics: google often measures user behavior on the live site and uses that data to improve the site.
This is the real rocket science. This is the stuff RIA/AJAX developers should be staying up all night working on. The rest is just plumbing.