Daniel Alexiuc
Daniel Alexiuc

Reputation: 13240

Caching JSON from ajax calls in indexedDB, checking for changes

I'm looking for a library or strategy that will do this:

I'm interested in doing this mostly for performance reasons, but this would also allow the app to work offline automatically which would be nice.

jQuery-offline does most of this, but only supports LocalStorage which has a small data limit, and I'm also not sure if it does the "change-checking", the doco is a little unclear.

Upvotes: 0

Views: 1123

Answers (1)

Kyaw Tun
Kyaw Tun

Reputation: 13131

I am creating a library something like that and looking for somebody to test out. Currently I have tested only with google cloud storage api (basically S3 REST API).

Basically it is a indexeddb wrapper library. You get/put/delete to the object store, the library will send corresponding XHR request for you. All database request return promise. You get data from the database on progress callback and final server result on done callback.

I have an angularjs sample app and some write up here. The app focus on query, but crud operation are there as well. Your server must provide etag for conditional requests. They are sample apps. Let me know if you have any problem.

Upvotes: 1

Related Questions