Skip to content

How does loading very large files in the browser work? #1629

Answered by axelboc
billyc asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @billyc, this has to do with the new H5WasmLocalFileProvider (and corresponding API: local/h5wasm-local-file-api.ts), which uses h5wasm inside a web worker together with the Emscripten WORKERFS virtual filesystem (instead of MEMFS filesystem). Contrary to H5WasmProvider, this new provider accepts a File object from an HTML file input and passes it on to the WORKERFS file system, so the file no longer has to be loaded into memory. Check out #1582 and #1604 for more info.

Now of course, this all works also because the viewer (i.e. @h5web/app) requests data and metadata lazily from the data provider, as the user explores the file. react-suspense-fetch is the library that enables us to do …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by axelboc
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants