Sprinkle Ajax with some scouring powder by Google Gears
Google has announced a nice way to support online and offline web-based applications with the same code using Google Gears. Gears originally had the code name "scour" leading to all sorts of puns in the code and mailing lists with "scouring powder" and so forth. And they say geeks have no sense of humor. I think of it as more of a "holy hand-grenade".
Anyway, the way it works is the user has to install ("ding ding whoop whoop whoop!" I can hear the alarm bells going off already, but wait, it's only 700K and there are no scary questions so pipe down)... ahem. As I was saying, the user installs a little browser plug-in which does three things, no more, no less. Four shalt thou not count, nor either count thou two, excepting that thou then proceed to three. Five is right out. (Hmm, maybe I should lay off the cough medicine). Those three features are:
LocalServer Cache and serve application resources (HTML, JavaScript, images, etc.) locally | |
Database Store data locally in a fully-searchable relational database | |
WorkerPool Make your web applications more responsive by performing resource-intensive operations asynchronously |
var rs = db.execute('select * from Demo order by Timestamp desc'); var index = 0; while (rs.isValidRow()) { recentPhrases[index] = rs.field(0); ++index; rs.next(); } rs.close();
I took out the error handling but you can see the whole sample on the Google Gears site, or go here for a demo. It's cross-browser, and cross-platform. And, oh yeah, open source (BSD license; not sure why that picked that instead of the Apache license Greg is so fond of).
Can't talk now, gotta go play some more with Google Gears. Meanwhile, install Gears for yourself, and check out the Samples and Tools zip. Whether you're doing battle with network latency, dealing with occasionally connected users, or putting the nail in that old fashioned office suite with your killer Ajax apps, Gears may be just the armament you need. Google Reader has already been fitted with it - will Mail and Docs and Spreadsheets be far behind? So go now, and "lobbest thou thy Holy Hand Grenade of Antioch towards thou foe, who being naughty in my sight, shall snuff it."