Hacker News new | ask | show | jobs
by cplantijn 3445 days ago
While I am fascinated by this, what are some good use cases for using offline storage? How can a web-enabled browser app benefit from offline storage? I've come to appreciate the power that client-side stores like what Redux and MobX provide, but what's the benefit and use case of using this?
4 comments

We actually use localforage as a backing store to "persist" parts of the redux store automatically.

The app itself is a freight logistics tracking and scanning app which is meant to download and store a few hundred MB of carton data and be able to scan and process it offline and sync back to a server when online again.

With redux-persist and localforage it's been effortless to enable this. Parts of our store are whitelisted and are persisted to localforage every 300ms or so. When the app is loaded the next time it pulls the data from localforage and "rehydrates" the store with it so it's like we never left the page in question.

This is good for storing data across sessions, whereas Redux/MobX lose data once the user closes the tab.
You usually use localStorage for e.g. user settings that are not stored on the server. There are many sites that give you the possibility to change a preference or two without the need for an actual account on the site. That sort of information is usually stored in one of the client-side storages.
I think Splitons is a good example of an App using rightly Local storage combined with AppCache : splitons.com

It keep tracks of expenses offline and sync states when you have connectivity again.