Optimizing Using Cached Resources, Possible issues?

Hi guys,
The following lines used to work caching the models loaded

let canvas = document.getElementById(id);
let engine = new BABYLON.Engine(canvas, { preserveDrawingBuffer: true, stencil: true });
BABYLON.Database.IDBStorageEnabled = true;
engine.enableOfflineSupport = true;

Using the new stable version, it does not work, there’s any additional implementation that I’m missing? Does it exist a new restrictions from browers about the file sizes? I put the commented lines at the beginning of the function. The .glb file is under 90mb.


Thanks in advance!

I believe the max size is 128MB but I can be wrong. Do you have any error in the console?

Hi Deltakosh,
there’s no any errors in the console, I return back to the version 3.3 and everything works, but the version 4.2.0 does not work.

And what about 5.0?

The same issues, the next pics belongs to the fourth load.

can you repro on the PG so I can see what is going on?

Hi DeltaKosh,
I just tried on the PG and works!!!
Create a Simple World Series | Babylon.js Playground (babylonjs.com)

I’m using the babylon.js and babylonjs.loaders.js libraries, should I include any extra library using the new versions?, using the version 3.3 with these two libraries works without any problem.
Thanks for your help!

I just gave up! I was thinking there were some issues, because I was using a fetch function to get the valuea, valueb and valuec => loader.addMeshTask(‘valuea`’, ‘’, ‘myurl’, ‘valueb’), if you aske me why? it is because sometimes there are several assets that integrate a model and I use the additional valuec that is a number to help me to iterate in the following steps:

let loader = new BABYLON.AssetsManager(scene);
let counter = 1;
while (counter <= valuec) {
loader.addMeshTask('valuea', '', 'myurl', ${valueb}_${counter}.glb`);


I have the same issue. ^^
I have a lof ot GLB and I need to make them in cache, and load them from it instead or URL.

I don’t clearly understand your last answer.
Have you find a solution? If yes. can you explain me. =)

Best regards.

Could you repro in the playground ?

As a general rule those days, I d try to rely on service workers to cache expensive data so that you can also use them offline and such.


I just want to put my GLB in cache to load fast.

I have all exactly as ladrian in his first message, so manifest for each GLB with correct values in it, and enable all of BabylonJS offline system, but still not work and no error in the console.

BabylonJS 4.2.0

If I understand his last answer, he just uses AssetsManager and addMeshTask instead of importMesh (due to not offline cache compatible anymore in 4.2.0) ?

Best regards.

I am sorry I am still unsure of the issue :frowning: If you could create a repro in the playground we ll fix it in no time !!!