I’m trying to use rel=“preload”, to begin downloading .gltf and .dds assets before the application’s JavaScript bundle (including Babylon.js) has finished downloading and parsing. Unfortunately Safari doesn’t make this easy, and you need to use a very specific fetch() API configuration or it will turn into a duplicate HTTP request.
Once I’ve added the <link rel="preload"...> tag to the document.head as shown above, is it possible to configure SceneLoader with options equivalent to the Fetch API configuration shown? E.g. SceneLoader.LoadAssetContainerAsync. I have found the WebRequest documentation but it seems to assume the request will be made with XmlHttpRequest rather than fetch(). Thanks!
Babylon.js isn’t able to use the fetch APIs because they are not available on old browsers. I’m not aware of a way to preload using XHR, so I don’t believe there is a way to configure this directly.
@roland’s solution seems reasonable. You can also create a blob url instead of a file if that is easier.
That works for me, thanks! I suspect there’s a way to preload with XHR too, but given the browser-specific differences with preloading (which are at least documented for Fetch on Stack Overflow) I’m hoping to stick with the Fetch API.