takahirox / three-gltf-extensions

Unofficial Three.js glTF loader/exporter plugins
MIT License
123 stars 20 forks source link

GLBRangeRequests: Avoid duplicated full content download #90

Closed takahirox closed 1 year ago

takahirox commented 1 year ago

If server doesn't support range requests it responds with 200 status and full content for range requests. FileLoader raises an error if it receives 200 status for range requests.

Currently the plugin invokes glTFLoader.load(url) as fallback if detecting an error while loading json chunk. The fallback load(url) can cause full range request.

This commit avoid the duplicated full range content downloading by reusing the full content loaded by the first range request.

Probably duplicated full range content downloading may not be a big deal because browser's disk cache works. But just in case we want to avoid it even in JavaScript level.