The code for createLazyFile is pretty simple, it just fetches chunks when
they are needed and then they remain cached, so the code would need to be
improved to allow removing old chunks to save memory.

Another option that might be relevant is the newer fetch API which provides
range downloads etc., it might be simple to build what you want on top of
that,
https://kripken.github.io/emscripten-site/docs/api_reference/fetch.html#byte-range-downloads

On Tue, Feb 27, 2018 at 10:39 AM, <[email protected]> wrote:

> I'm working on a WebAssembly port of GDAL, and one common use of GDAL that
> I'd like to support is using it to access large GeoTiffs via HTTP. To
> accomplish this, GDAL normally uses libcurl and issues range queries for
> the data it needs (which is often a small subset of the entire file).
>
> I'd prefer to avoid compiling libcurl into my WebAssembly, so I'm
> intrigued by Emscripten's createLazyFile() functionality -- it seems like
> it might allow me to transparently accomplish something similar to GDAL's
> use of libcurl.
>
> What I'm wondering is what kind of caching the lazy file does; these
> GeoTiffs can often be several gigabytes in size, and someone processing a
> file in chunks (for example, generating tiles for display on a web map)
> might, over time, download the entire file or a majority of it. Would this
> cause the entire file to get cached in browser memory? If so, what would be
> the best way to prevent that from happening? I'm prepared to write my own
> version of createLazyFile if necessary, but I want to make sure there's not
> an easier way before I dive into that.
>
> Thanks for any help you can offer!
>
> Derek
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to