Saturday, June 30, 2007

Google Gears and client side caching

This is getting more and more interesting. Today I read an article that explained Google Gears very lucidly.

I think, this is going to make UI coding and the design patterns still more interesting. Large parts of relatively static data can be cached on client side, data that the browser cannot cache easily, like DHTML tables. I am wondering if I can use it in my Flex 2 application.

I guess the only downside is that the user will be asked to install Google Gears on their desktop. I don't see much of a problem, since I used it for Google Reader. However, if this was used with some more critical application, I will probably think twice before I do that.

Here is an interesting code snippet, originally here:


function initializedb() {
if (!window.google || !google.gears)
return;

try {
db = google.gears.factory.create('beta.database', '1.0');
} catch (ex) {
alert('Could not create database: ' + ex.message);
}

if (db) {
db.open('gearsintro');
db.execute('create table if not exists articles' +
' ( article_id int, title varchar(255), content text )');
}
showArticles();
}

Labels: , , , , , ,

0 Comments:

Post a Comment

<< Home