DEV Community

Discussion on: mobile local web-server to store local data by a web app

Collapse
 
fc250152 profile image
Nando

Hi friend, thank you so much for your comprehensive and exhaustive explanation.
I will study carefully each of the options you have exposed.

Only to better define the scenario already in place:

  • the app in the browser receives from the main web server one or more "documents" to complete offline, then transmits them back to the same server when they are ok.
  • in order to work offline, the app uses the AppCache for the pages and the LocalStorage to store the data.
  • the data are stored in a different format with respect to the one that they have in the main server: an "internal" format, known only to the front-end app.

In the "new scenario" I would give up both the AppCache and the LocalStorage, and possibly also the other limitations imposed by the browser by "proxing" data operations to a local (pseudo)webServer.
That's all.

Many thanks for your help!
Have nice days
Nando

Collapse
 
rhymes profile image
rhymes

I think you could go incremental with this thing. First use localForage or a similar option so that you can abstract from localStorage and maybe use IndexedDB. Then you can look into replacing AppCache with Service workers.

If that it's not enough then you can write all the code to proxy the webserver.

I'm just saying this because that option seems the most complicated and the one with the most code, while you can maybe settle to not having a proxy at all.

Have fun!