Versatile software engineer with a background in .NET consulting and CMS development. Working on regaining my embedded development skills to get more involved with IoT opportunities.
A lot of developers forget that they have a nearly universal cache available to them...HTTP caching! If you use cache headers correctly, the browser does all of the work for you!
Client-side caching also forces you to consider a lot of security concerns. A user can easily access session state and modify it, compromising the integrity of saved responses and injecting untrusted data that is about to be parsed. SessionStorage is also synchronous, so the retrieval will be a blocking operation.
I would encourage you to explore service workers to handle your caching needs. IndexedDb gives you the power to store more expressive relational data and it is asynchronous to boot!
Although I think that your concerns should be highlighted in the article so, what do you think if I add them as a warning, with credits to your comment?
Versatile software engineer with a background in .NET consulting and CMS development. Working on regaining my embedded development skills to get more involved with IoT opportunities.
A lot of developers forget that they have a nearly universal cache available to them...HTTP caching! If you use cache headers correctly, the browser does all of the work for you!
Client-side caching also forces you to consider a lot of security concerns. A user can easily access session state and modify it, compromising the integrity of saved responses and injecting untrusted data that is about to be parsed. SessionStorage is also synchronous, so the retrieval will be a blocking operation.
I would encourage you to explore service workers to handle your caching needs. IndexedDb gives you the power to store more expressive relational data and it is asynchronous to boot!
I believe you can use localforage library to asynchronously store data.
Although I think that your concerns should be highlighted in the article so, what do you think if I add them as a warning, with credits to your comment?
Please feel free to do so! If you have any questions along the way feel free to ask.
This is an alternative for simple cases in which introducing a service worker or an indexedDB database would be an overkill,