Google Gears

Standard

Google  gearslogo_153x43    which has been greatly talk about since its release by the web giant Google has spurred a lot of talk about how web application will be in the current and near future. Gears offers to provide features that are currently needed to speed up “heavy” (memory and data) intensive web application as well as provide off-line abilities.  Gear provides the following accents for web applications :

Local Database

This is used to stored user application data locally on the users computer, providing if not exactly, close off-line db store to OS desktop applications. Gears uses the open-source db SQLite for this functionality and supports normal SQL query.

 

Local Server

The local Serve allows you to cache application information on the client and and serve them locally instead of going back to the server. It can also to automatic updates for URL resource behind the scene.

  

Applications manage the cache using two classes:

  • ResourceStore – for capturing ad-hoc URLs using JavaScript. The ResourceStore allows an application to capture user data files that need to be addressed with a URL, such as a PDF file or an image.
  • ManagedResourceStore – for capturing a related set of URLs that are declared in a manifest file, and are updated automatically. The ManagedResourceStore allows the set of resources needed to run a web application to be captured.

For both types of stores, the set of URLs captured is explicitly controlled by the web application.

Serving and updating cached resources

The LocalServer intercepts HTTP/HTTPS requests and serves them from the cache when all of these conditions are met:

  • The URL is cached in a ResourceStore or ManagedResourceStore,
  • The store’s enabled attribute is set to true, and
  • If the store has a requiredCookie attribute, the request must have a cookie that matches. For further details read Cookies and the LocalServer.

The LocalServer always serves a cached resource when the conditions are met, regardless of the network connection. The URLs contained in a store are eligible for local serving without requiring the application to open the store.

To disable local serving of stored resources and force URLs to be served using the regular network connection, the application can set the store’s enabled attribute to false.

 

WorkerPool

This allows you application to spin off asynchronies processes (with JavaScript) without halting the browser or slowing its responsiveness.

 

These are all great features that web developer have  been wanting for many year now.  A co-worker asked “This is all great news but why do we need another 3rd party engine in our browser to make this happen. We already have flash and the upcoming Silverlight from MS “. Well, flash and Silverlight offer’s similar features like local data store but they also add the extra hefty runtime engine to make it all happen instead of improving the existing and most widely used tools (HTML , CSS, JavaScript etc) .

That’s not to say that Flash, Silverlight and others are about to be left in the dust. If the is one thing they “still” have over Goggle gears, it’s the fact that the UI presentation is the same in any browser. That take away the hustle of testing web application in multiple browsers due to different implementation of the W3C standards. This might change as  like IE (with IE 8 coming up) are becoming more compliant then ever.

There is a lot of speculation as to what will happen to Gears or flash /Silverlight etc, but for now, a better solution for developing off-line web application (using our long existing knowledge of JavaScript, CSS, HTML ) have arrived and should be well noted. Gears is not for every application but if the features fits what you are looking for in your app, take a good look at it.