html5 – Is it possible to store js / css / html data in LocalStorage?

Question:

Is it possible to store js / css / html data in LocalStorage so that it does not drag on every reboot?

Answer:

What about reinventing the wheel? The cache has long been implemented in all browsers without any tweaks with localStorage . If the URL and the hash of the file on the server do not change, and you do not send an explicit prohibition on caching resources in the headers, these resources will be stored in the cache and will be pulled from it when the page is refreshed. Also, the cache, unlike localStorage , is less limited in size, the browser can cache at least all the static content of your site, while only 2.5-10 MB of data localStorage be localStorage in localStorage .

Scroll to Top