Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure asset-loading elements cancel network requests if they will load a new asset. #305

Open
trusktr opened this issue May 24, 2024 · 0 comments

Comments

@trusktr
Copy link
Member

trusktr commented May 24, 2024

For example, when the src attribute of a <lume-gltf-model> element changes, the previous network request (if any) is currently simply ignored but not canceled, then a new network request for the new src is created, meaning that multiple network requests will be happening at the same time. If you change the src attribute 5 times before models were loaded, then up to 5 network requests will be happening in parallel while 4 of those will be ignored (and any results garbage collected).

Instead, we should cancel any previous network requests rather than simply ignoring them.

But in order to do this, we first need to add this ability to Three.js which abstracts away the network requests behind its API and the only way to "cancel" a loader is to ignore its result (hence the network requests are ignored).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant