PDA

View Full Version : Gears, Direct, easy offline cache



wizgrav
31 Aug 2009, 2:26 AM
This provider is derived from RemotingProvider and provides a gears cache for ext direct transactions. It doesn't have any change in functionality or usage from the original. When transactions fail (after all retries), the cache is checked and stored data retrieved for the particular method call and arguments. A new event(statechange) is also added to indicate transition to online or offline state. When the data come from the cache the event object carries a "gearstamp" integer timestamp to indicate the time of the last update. The only change that needed in the api file is "remoting" => "gremoting". With a bit more javascript(http://gears.google.com) you can take your web apps offline easily. Enjoy

aconran
31 Aug 2009, 12:00 PM
Interesting idea. how is this working out for you? Have you run into any issues?

wizgrav
31 Aug 2009, 9:58 PM
We decided to base our content sites on ext direct. With this hack they become viewable offline with little extra effort. You just need to add some more javascript to cache images and application resources (css,pages,js files etc) using google's Localserver. So far the only issue I had was when you have the gears plugin installed but deny authorization to the page via the startup dialog. It's just one more check though. Besides that the functionality is completely transparent to the user, the gremotingprovider acts exactly like the remotingprovider when gears is absent. I'm now investigating if and how could it be used in the writer. To be honest, I've only tested it in Chrome but the plugins in the other browsers should behave the same

jitu
2 Mar 2010, 2:12 AM
I have two database one is localserver(google gears) and second is mysql(php)
I ant to synchronize these two database.Means When I offline data is stored in a localserver
and when I online it is stored in a mysql, so I want when I online the data in google factory will insert in mysql So I will get offline dat also.....

any clue please help me.....