6 ms·
> It seems like the key requirements here are 1. Ask permission first and 2. Strongly cache the downloaded data. This is just like downloading a desktop game.
by jsheard 3y ago
> It seems like the key requirements here are 1. Ask permission first and 2. Strongly cache the downloaded data. This is just like downloading a desktop game.
There's no sure-fire way to cache large amounts of data in a browser, all you can do is pray that the browser decides to keep it. The more data you load, the less likely that is.
It's a problem that has to be solved at the standards level, adding some kind of "persistent data" permission, but it's been a known issue for years and there's been no progress.
- kevincox 3y agoYou can request this via https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist https://developer.mozilla.org/en-US/docs/Web/API/StorageMana.... If the browser reports that the request was granted that storage should not be cleared except by explicit user request.
- jsheard 3y agoIn practice there are limits, it would be very rude to let random websites fill your entire disk until you manually clear the storage. This page tests how much you can store in practice, the current versions of Chrome and Firefox both seem to barf after storing just 10MB: https://arty.name/localstorage.html https://arty.name/localstorage.html . What I meant by a persistent data permission is adding an explicit permission prompt which allows an app to bypass that limit and store any amount of data, if the user allows it, which you can't currently do.