geotiff.js icon indicating copy to clipboard operation
geotiff.js copied to clipboard

BlockedSource: Duplicated HTTP range requests

Open sguimmara opened this issue 1 year ago • 3 comments

We are using geotiff.js to retrieve COG data in Giro3D, as seen in this example: https://giro3d.org/examples/cog_elevation.html

Many times, we see that the exact same request is sent by geotiff.js: same URL, same Content-Range and Content-Length headers, resulting in a massive increase of the data to download. Depending on the compression used, and the bitness of the image, the increase can be catastrophic.

The displayed terrain is subdivided in a hierarchical grid, meaning that there will be some overlap between grid cells and COG tiles: the same COG tiles will be shared among neighbour cells. Now I expect that the BlockedSource deduplicate requests for the same slice of data, but it seems that it does not (or at least not always).

image

sguimmara avatar Apr 04 '24 07:04 sguimmara

Can you check if https://github.com/geotiffjs/geotiff.js/pull/381 fixes your issue?

jcphill avatar Dec 14 '24 11:12 jcphill

Can you check if #381 fixes your issue?

I'm testing right now, but #382 prevents the use of the tile cache, so your optimization is never used :(

sguimmara avatar Dec 16 '24 09:12 sguimmara

So with applying the fix for #382 I don't see any duplication in requests anymore (previously, some tiles were loaded 2, 3 or even 4 times)

sguimmara avatar Dec 16 '24 09:12 sguimmara