Question

am sorry for this question, but everyone here is talking about IndexedDB, WebSQL, Local Storage, so my question is simple:

If the application is always refreshing new contents (think Facebook, or an ecommerce website), so does it make sense to use the Offline storage? if yes, then what do i store? the user's files?

Was it helpful?

Solution

Yes, it make sense.

Suppose, we have a lot of user data and application data. Application data is shared for all users, while user data is private to login user. Two client side databases are used. The data are store in IndexedDB (or WebSQL). As soon as user visits the page, the data is rendered immediately without sending a request to the backend server.

After rendering the page, XHR GET request is sent with If-None-Match etag header. Server will reply with 302 or 200 depending we need to update or not. That saves bandwidth and server load.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top