Disk Caching for Babylon Native

I recall some time ago there was some discussion regarding disk caching for Babylon Native Kinda like browser caching works . Wondering if there has been any traction on that or if its on the roadmap. @sebavan @bghgary . If its not on the roadmap, Id love to know your thoughts on this and if we all agree it would be coo, what would be a realistic ETA ? Since network transition time is our largest bottle neck for our backend rendering which we do via Native and Azure instances, having disk caching would be a huge performance boost especially since for most requests we are using the same assets.

@bghgary @sebavan

I think we were talking about caching shaders earlier. This request is a bit different. Babylon Native uses the OS APIs to download from HTTP. I would expect the OS to do some caching. Maybe we have to explicitly turn this on. You are running on Windows yes?

Ah yes thats the clarification, this is for assets (models/textures) not shaders. And Correct, we are on windows on an Azure CPU instance. One thing is for sure every time we see a request even for the same asset we are seeing new network traffic, it does not appear to be loading from cache. We were going to come up with our own system of dowloading the files to a local disk cache on the vm and loading from there for subsequent requests but it would be great if this was just part of Native. Kinda like how this works Babylon.js docs

The code for this is here: UrlLib/Source/UrlRequest_Windows_Shared.h at main · BabylonJS/UrlLib (github.com)

It seems like there might be a way to pass a constructor argument (maybe this) to tell this API to use the cache. If you have the bandwidth, you can try changing this to see if it works.

hmm interesting. I’ll look into this. Thanks Gary, we can try to give this a crack but wouldn’t mind if you guys gave it a shot too if it seems to be simple. :slight_smile:

found this. worth a shot.


I don’t have the bandwidth at the moment for new features. If this can wait a month or so, I should be able to do something, but I’m not sure if that timeframe is too slow.

Understood, we will try your suggestions and we can check back later with you on this.


1 Like