ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
577 stars 170 forks source link

web-ifc is reloaded for every model #871

Closed janruo closed 1 week ago

janruo commented 1 month ago

Describe the bug 📝

Every time fragmentIfcLoader.load() is called, it makes a new request to the 1.1 MB web-ifc wasm file.

The browser will most likely cache the request, and everything seems to be properly garbage collected anyway, so this shouldn't cause any real problems, but it still seems unnecessarily wasteful:

kuva

Reproduction ▶️

No response

Steps to reproduce 🔢

Call fragmentIfcLoader.load() more than once.

System Info 💻

@thatopen/components 2.0.6

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

agviegas commented 2 weeks ago

Maybe web-ifc can cache the WASM file once it has it. I'll move the issue there.

beachtom commented 1 week ago

This is fixed @agviegas somewhere in fragments something is callined ifcAPI.Init() multiple times. But I have added a check so even if it is called multiple times it will not download the wasm again