Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Web Storage Portability Layer

shichuan edited this page Feb 14, 2011 · 2 revisions

iPhone and Android-powered devices uses the Web Storage Portability Layer (WSPL) to let the same database code run on browsers that provide either Gears or HTML5 structured storage facilities. The WSPL consists of a collection of classes that provide asynchronous transactional access to both Gears and HTML5 databases.

Also included in the distribution is a simple note-taking application with a persistent database cache built using the WSPL library. This application is an example of the cache pattern for building offline web applications. In the cache pattern, we insert a browser-local cache into the web application to break the synchronous link between user actions in the browser and server-generated responses. Instead, as shown below, we have two data flows. First, entirely local to the device, contents flow from the cache to the UI while changes made by the user update the cache. In the second flow, the cache asynchronously forwards user changes to the web server and receives updates in response.

Read the original article here.