I've been hitting F5 on the BandaAncha forums since the beginning of the month and asking around on IRC to see if some charitable soul would drop one of those coveted invites. Last night, an email hit my Hotmail account. It was from a buddy from university. Subject: Google Email Invite.
I almost spilled my Cola Cao all over the keyboard. No more having to log in every three days to delete emails with 100 KB attachments just to keep the inbox from locking up. No more of that damn "Your mailbox has exceeded the 2MB limit" banner. It took a couple of weeks, but I'm finally in the Gmail beta.
A quantum leap in storage
This Google thing makes no sense. When they broke the news on April 1st, many of us thought it was a typical April Fools' Day joke. 1 Gigabyte? 1024 whole Megabytes, for free, just like that? My tower's main hard drive, a Seagate Barracuda I bought a couple of years ago, is 40GB. They are giving away the equivalent of an entire partition just to store text and photos we forward to each other.
Until now, you had two options. You either resigned yourself to the sluggish Hotmail or Yahoo interface, where reading three emails in a row meant watching the Internet Explorer logo animation umpteen times... or you configured POP3 in Outlook Express or Mutt, downloading emails to your PC and praying your 256kbps Telefonica connection wouldn't drop halfway through a moderately large attachment. I myself had a cronjob with a Perl script that connected via POP3 and dumped my emails to my local disk, then purged them from the server. All very manual and rudimentary.
With 1GB, the idea of "deleting emails" vanishes. Google's approach is that you archive everything and use their built-in search engine to find anything. They force you to shift your mindset: you no longer sort into dozens of hierarchical little folders, you just search.
The real revolution: DHTML and XMLHTTP
But what drives me craziest isn't the space, it's how the interface is built. It doesn't reload the entire page every time you click on an email or open a folder. It's lightning fast.
I started poking around the source code using the extensions console of the new Mozilla Firefox 0.8, and it's black magic. They are using a Javascript object called XMLHttpRequest (which I think Microsoft invented for IE5 years ago, but hardly anyone paid attention to) to request data from the server in the background and update the DOM on the fly using pure DHTML.
I've tried replicating it locally with the Apache 1.3 server I have on my machine, and the basic idea goes something like this. A small practical example I've been testing:
// La magia detrás de la interfaz que no recarga
var http_request = false;
// Instanciamos el objeto dependiendo del navegador
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest(); // Para Mozilla, Safari...
} else if (window.ActiveXObject) {
http_request = new ActiveXObject("Microsoft.XMLHTTP"); // Para IE6
}
http_request.onreadystatechange = function() {
// Si la petición ha terminado y el servidor responde 200 OK
if (http_request.readyState == 4 && http_request.status == 200) {
document.getElementById('bandeja_entrada').innerHTML = http_request.responseText;
}
};
// Llamamos al servidor sin refrescar
http_request.open('GET', 'leer_correos.php', true);
http_request.send(null);
It's technical genius. Now you have the fluid experience of a desktop application, but living directly inside the browser.
What lies ahead from now on
Honestly, I don't know how Google plans to monetize this in the long run. Giving 1GB to millions of users (when they open the beta to everyone and drop the invites) is going to require server farms I don't even want to imagine. I suppose they'll scan the text of the emails to put AdWords ads on the side. Doesn't seem like a bad deal if in return they give me this beast of a service that doesn't crash every two minutes.
What I am certain of is that this is going to change how we build websites. If you can load data without refreshing the page in such a stable way, a whole new world opens up for management applications. Today it's email, but tomorrow we could have entire word processors or calendars working like this. For now, I'm going to keep tinkering with this code to see if I can apply it to the admin panel I'm working on, assuming IE6 leaves me alone and doesn't throw a script error blue screen at me.