A
|
acpan 9/3/2021 |
I have recently implemented offline storage in PHPRunner app, mainly for storing and retrieving config and user's preferences. the user expereince is good, and I had used Web Storage for that. I am by no means expert, so here's just sharing some background about the Offline Storage and where i see PHPR app possibly fits in: A bit of Background There are mainly 2 offline storage methods used currently. Web Storage and IndexDB Web Storage (a.k.a localStorage and sessionStorage):
I find it very useful in the following situations:
indexedDB:
Difficult to support, if there is a problem, and it is due to indexDB residing in a user browser, developer can't see what's going on there. They are some wrapper libraries out there, but imo, it adds another layer of debugging uncertainty to it. Some say indexDB is horrific, I can imagine that. However, i would be interested to try again at a suitable time when things are less complicated. indexedDB info, if you are interested to learn more. Refer to this link for more detail discussions. The thread is quite old, but many of the things still apply. |
A
|
acpan 9/3/2021 |
Playground Try W3School - WebStorage API and open your Chrome Console, and click to Applications Tab and observe the data stored in your browser's local storage. The above Web Storage is a good start to understand it and actually implement it in PHPRunner App. There is also a forum member asking about putting a few lines of webstorage javascript codes into Javascript Onload Event recently and had sucessfully done it, you can get some hint there too. There are areas to consider too, such as versioning and caching of JS/CSS/HTML assets, and other related technologies, such as Service Workers, Background Sync etc, but this is another topic altogether. |
J
|
JeffDeveloper author 9/7/2021 |
Thanks @acpan. This is very interesting and I will definitely look into this. |