Google Gears: Offline Applications

July 28, 2008 – 10:30 am by Lord Ravenclaw

What is Google Gears?

As defined by the Gears website

Gears is an open source browser extension that lets developers create web applications that can run offline. Gears provides three key features:

  • A local server, to cache and serve application resources (HTML, JavaScript, images, etc.) without needing to contact a server
  • A database, to store and access data from within the browser
  • A worker thread pool, to make web applications more responsive by performing expensive operations in the background

I recently discovered Google Gears from Wordpress. Wordpress mentioned that version 2.6 included a caching mechanism for the Dashboard by using the Gears browser plugin with the Javascript API. I was intrigued. After some short research, I realized the power of Gears and within a few hours implemented a working cache system to cache the some ~75 static files that PatronusCharm uses around the site including images, CSS, and Javascript. Gears works by caching these files locally and intercepting HTTP/HTTPS requests for these files and serving them. After implementing it I noticed it was noticeably snappier than before. But this is only stage one, and what will be rolled out with 1.0.2 due next weekend.

In 1.0.3, I’ll be rolling out stage two. Stage two will be a lightweight version of PatronusCharm. This version of PatronusCharm will cache the entire site with Gears. It will be especially designed to allow users to store and read stories offline using the familar interface of PatronusCharm. If all goes well, users will also be able to review each chapter while offline and have PatronusCharm Offline synchronize the reviews with to the server when connectivity is restored. At this time, it will also check for updates on each story. :)

Google Gears is pretty exciting, as while like every technology is blogged about for ages, this is one of the few I feel could really take off. I’ll for sure be taking advantage of its features. It’s pretty genius to not only provide a cache which intercepts HTTP/HTTPS requests, but access to SQLite databases, threaded javascript, threaded timers, threaded AJAX, and desktop icon helper code. It’s a step towards bringing web applications into the world of offline applications. I’m also quite excited to get this working on PatronusCharm, reading stories offline has long been a goal of mine. I never quite thought it’d be this easy to allow users to click a button and read stories offline however.

We’re not quite there yet, there’s still plenty to do, however 1.0.3 will be an exciting release, and I look forward to working on PatronusCharm Offline.

Post a Comment