Hello friends
I’m trying to use indexdb caching as written in this document.I find that,if there is only one model in the scene,it can be stored correctly:
When page refresh,the other models are still loaded from the web server.
My loading code is:
BABYLON.SceneLoader.ImportMesh("","../TESTMAP2/ASSETS/wrjtiles-mg-tc/", "Tile_+000_+001-19-tc.glb", scene
, function (newMeshes, particleSystems, skeletons) {
console.log("mesh1",newMeshes.length);
var mesh=newMeshes[0];
});
How dare you call me amazing at this… I’m more like minimally competent. At best.
A quick hypothesis (with lots of probably wrong assumptions) for the behavior you’re seeing is that with regards to caches and unique URI’s, the Tile assets are all considered to be unique from each other due to differences in querystrings and file names.
I’ll have some time later today to look more closely though
Thank you for your help!I have learn the document you provided to solve this problem.
In my attempt,the first step is to build a local area network https server with mkcert.I found that the load speed of http and https Is similar:
(The upper is http,the under is https)
The second step is to write a sw.js to manage the glbs.Benefited from the sw cache the load speed is greatly improved:
Fwiw, The npm package workbox is nice for quickly setting up a SW with prefetch if you haven’t already considered it - helps avoid having to write lots of boilerplate code!