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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top