Abdelouahab Pp
Abdelouahab Pp

Reputation: 4440

HTML5 Offline Storage use case?

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?

Upvotes: 0

Views: 290

Answers (1)

Kyaw Tun
Kyaw Tun

Reputation: 13131

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.

Upvotes: 1

Related Questions