# About Optimizing Using Cached Resources

**URL:** <https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771>\
**Category:** Questions\
**Tags:** documentation\
**Created:** [March 14, 2024, 12:11pm UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771 "2024-03-14T12:11:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiger\_yang](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tiger_yang/32/33056_2.png) [@tiger\_yang](https://forum.babylonjs.com/u/tiger_yang)\
**Post date:** [March 14, 2024, 12:11pm UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/1 "2024-03-14T12:11:18Z")

</div>

**It should be named NameOfYourScene.babylon.manifest**  
I really did not understand this sentence in the document, it is not friendly at all!!!  
such as how to name the manifest file? If I load this scene in app.vue, it should be called app.babylon.manifest?  
And where in the project should the file go? Same directory as app.vue file?

Through the documentation, I don’t know how to do this！！！

I’ve already set these properties to true

```auto
   BABYLON.Database.IDBStorageEnabled = true;
   engine.enableOfflineSupport = true

```

Please help me, how should I use IndexedDB automatically ！！！ 😭

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 14, 2024, 3:14pm UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/2 "2024-03-14T15:14:19Z")

</div>

Manifest is required if you want to control the version of the resources you are downloading. The manifest file should be in the same base directory oft he asset you are downloading. Note that the assets is a scene file - either a .babylon file or a downloadable asset. And it shoudl be called the-asset-that-you-load.[extension].manifest

You can disable the manifest check to simplify the process. adding `engine.disableManifestCheck = true;` will get it to work without manifest files. You will then have an indexeddb DB called babylonjs with the scene, textures, etc’.

---

<div class="post-metadata">

**Author:** ![tiger\_yang](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tiger_yang/32/33056_2.png) [@tiger\_yang](https://forum.babylonjs.com/u/tiger_yang)\
**Post date:** [March 15, 2024, 1:51am UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/3 "2024-03-15T01:51:55Z")

</div>

Thank you. It worked. I tested several scenarios:

1. The .babylon model file works with the.manifest file
2. The .babylon model file and **engine.disableManifestCheck = true** without the.manifest file can also works
3. The .glb model file and the.manifest file without **engine.disableManifestCheck = true** do not work together
4. The .glb model file and **engine.disableManifestCheck = true** without the.manifest file can also works

Am I right in this conclusion?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 15, 2024, 7:16am UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/4 "2024-03-15T07:16:52Z")

</div>

Yes, that seems about right. The manifest file was created for the .babylon format. It was meant as a global manifest for the entire scene, and not for individual assets, though i think there shouldn’t be a reason not to support our with other formats.  
Just don’t forget, that when you don’t have a manifest you will need to take care of clearing the assets from the local db if they changed online.

---

<div class="post-metadata">

**Author:** ![Alexander\_Sosnovskiy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alexander_sosnovskiy/32/30165_2.png) [@Alexander\_Sosnovskiy](https://forum.babylonjs.com/u/Alexander_Sosnovskiy)\
**Post date:** [March 16, 2024, 6:55am UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/5 "2024-03-16T06:55:41Z")

</div>

Could you please explain about pros and cons of offline indexedDB vs browser’s cache vs service worker?

Seems like service worker works best for offline support, but maybe I missed something

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 18, 2024, 4:03pm UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/6 "2024-03-18T16:03:25Z")

</div>

Service workers are a great way to support offline users, for sure. All of those work a little differently TBH. You can read about the different technologies on your favorite free source of information 🙂

Babylon’s offline support was implemented way before service workers were a thing, so we used indexedDB. Is it the best? maybe not. Does it work? it sure does! Cross platform as well. It all depends on your usecase and how you want to manage your offline data.

---

<div class="post-metadata">

**Author:** ![jelster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jelster/32/25881_2.png) [@jelster](https://forum.babylonjs.com/u/jelster)\
**Post date:** [March 19, 2024, 1:47pm UTC](https://forum.babylonjs.com/t/about-optimizing-using-cached-resources/48771/7 "2024-03-19T13:47:07Z")

</div>

IMO, IndexedDB is best for storing app-level data. Things like configuration, profile data, etc. things that your app will mutate and persist across sessions.

Service Workers are great for offloading work from the main UI thread and for prefetching assets and such and work in conjunction with various browser storage schemes (including indexedDB if you want!).

Browser caches are simple, effective, and largely transparent to the app, but due to the vagaries of different browser, machines, and users, can be unpredictable and tough to preserve offline

As Raanan said in his reply, the various technologies have more details on each. As well, if you happen to have a copy of my book available (search Going the Distance Babylon.js for more) the chapter on PWA’s and IndexedDb cover these topics in good detail

HTH!
