This feature is old and was written when IDB and JavaScript were younger ![]()
We need to:
- Use async or promises
- Clean the code
- Make sure we cache gltf/glb files
- Make sure the feature works as intended
*Ported from GitHub
This feature is old and was written when IDB and JavaScript were younger ![]()
We need to:
*Ported from GitHub
I agree. I think the Cache API could prove very useful in solving this problem.
I have never used this before but Ive always wondered about cache size limits?
According to the Cache API docs I linked above (paragraph 3):
Each browser has a hard limit on the amount of cache storage that a given origin can use.
Cachequota usage estimates are available via theStorageManager.estimate()method.
Running await navigator.storage.estimate() in DevTools for this page I get the following object back:
{
quota: 379790760345, // 379GB
usage: 243248, // 243KB
usageDetails: {
caches: 235008, // 235KB
indexedDB: 5755, // 5.7KB
serviceWorkerRegistrations: 2485, // 2.5KB
},
}
So the available space depends heavily on the storage available on the device.
Also, and algorithm is different on chrome and firefox but its something like half of the users available hard drive space, then for an individual domain, it depends on how much other domains are taking up. Regardless, its a lot. You can run 100gb pretrained inference ml models in your browser, for example.