emscripten-core / emscripten-core/emscripten
[Feature request] Allow loading data from browser storage (IndexedDB/other) to avoid re-downloading files
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I have an application compiled with Emscripten that outputs a `.data` of 250Mb.
My users are reporting download times varying between 2 and 30+ minutes. Given the size of the data file, most browsers will refuse to cache it.
Given that the application requires [persistent storage](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist), my plan is to store the contents of the data file on the client using IndexedDB and feed it to the application, to avoid an unnecessary request.
After some research, I found that although it is possible to change the location of the data file ([e. g. for CDN hosting](https://emscripten.org/docs/porting/files/packaging_files.html#changing-the-data-file-location)), it is not possible to point the Emscripten-compiled code to a non-remote location, whether it be a Blob object, an IndexedDB entry, or anything else.
Would it be possible to implement such a feature?
----------
The project in question is [SuperTux](https://github.com/supertux/supertux), you can find the development build [here](https://supertux.semphris.com/play)
Contributor guide
Assessment
This issue has not been assessed yet.