Is there a way to cache mesh data?

It’s explicitly stated here that textures are cached internally but from my brief testing, network requests keep getting sent out per mesh load, which leads me to think mesh data is not being cached.

I am trying to share resources between two scenes, one overlaying the other. Since it seems asset data is coupled to a scene, I have to load all the assets for each scene and duplicate mesh data, which is pretty bad.

Maybe @Cedric or @sebavan might have an idea of what’s going on?

I have no idea how cache works. Maybe also @RaananW can help here.

Enabling caching requires a manifest or turning off the manifest inspection. If you want to show us how you enabled cache, we can help with explaining why it doesn’t work.
On a single scene initialization, images with the same URLs will be internally cached and reused. So if you load 5 textures with the same URL, it will only load it once.

Thanks everyone for pulling together :smile:

By default images are internally cached, but for other assets the cache needs to be enabled? (Just validating the behaviour I’m seeing)

So when the cache is enabled, duplicate requests aren’t sent out (great), but if I load the same asset into two different scenes, internally is the vertex data duplicated or is there sharing between the scenes?

Textures will be internally cached in a single session. Reload the browser and the images will be loaded again. The Database class will enable offline support and persist caching for future usage for all web requests that use the Tools class, which is most of the requests we are making internally (models, textures and more).

Don’t forget that your browser also caches, at least for the length of a session (unless you actively disabled caching), so you have a few layers of caching in a single session (between reloads).