Baker Xiao Posted September 2, 2017 Share Posted September 2, 2017 I was trying to follow https://doc.babylonjs.com/tutorials/caching_resources_in_indexeddb and created manifest files for all my assets. I then used AssetsManager.addMeshTask to load some .babylon files which do have manifest files. The engine did request those manifest files and got them successfully from my server. However nothing is being stored in IndexedDB when I looked into my browser storage. Are we missing anything? Quote Link to comment Share on other sites More sharing options...
mirco Posted September 3, 2017 Share Posted September 3, 2017 Hi, to be sure, you webserver is responding correctly with a 200 status code for the manifest file, including a valid JSON ? Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 4, 2017 Author Share Posted September 4, 2017 @mirco yes the response is a valid JSON. however the content-type http header is text/cache-manifest. Quote Link to comment Share on other sites More sharing options...
mirco Posted September 4, 2017 Share Posted September 4, 2017 i tested it yesterday with the babylonjs 3.1. It works as expected. ( Firefox 55.0.3 on macOS 10.12.6 ) My Server returen a application/octet-stream. Can you attach your manifest file here? Whats Browser and OS do you use. How big are the Files you want to cache? Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 4, 2017 Author Share Posted September 4, 2017 I'm on Google Chrome 60.0 Mac OS 10.12.6. All my manifest files have the same content as this one: { "version": 1, "enableSceneOffline": true, "enableTexturesOffline": true, } They all got HTTP 200, however nothing is stored into IndexedDB, and every time it still goes to fetch the real babylon files over the wire. The babylon files are really small, about 50KB each. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 5, 2017 Share Posted September 5, 2017 Can you try to debug to see why the database is not used? Quote Link to comment Share on other sites More sharing options...
davrous Posted September 5, 2017 Share Posted September 5, 2017 Press F12 in Chrome and tell us if you've got errors in the console. If not, go to the application tab and check the IndexedDB part to see if your files are stored or not. Do you run Chrome in Incognito? If so, it disables IDB. Can you please also test https://www.babylonjs.com/demos/sponza and check if it works in your machine. This demo is using IndexedDB and has been tested successfully on several machines Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 5, 2017 Author Share Posted September 5, 2017 @davrous no incognito, no console errors, and nothing appears in IndexedDB. Something is silently failing. I will try to debug a bit and see what I find. I do get content in IndexedDB when playing most babylon demo scenes. Just not with my own game. Quote Link to comment Share on other sites More sharing options...
mirco Posted September 5, 2017 Share Posted September 5, 2017 hey, can you please try it without the last comma after enableTexturesOffline? 12 hours ago, Baker Xiao said: I'm on Google Chrome 60.0 Mac OS 10.12.6. All my manifest files have the same content as this one: { "version": 1, "enableSceneOffline": true, "enableTexturesOffline": true, } They all got HTTP 200, however nothing is stored into IndexedDB, and every time it still goes to fetch the real babylon files over the wire. The babylon files are really small, about 50KB each. { "version": 1, "enableSceneOffline": true, "enableTexturesOffline": true } Baker Xiao 1 Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 5, 2017 Author Share Posted September 5, 2017 11 hours ago, mirco said: hey, can you please try it without the last comma after enableTexturesOffline? { "version": 1, "enableSceneOffline": true, "enableTexturesOffline": true } LOL that's it! Seems my linter was too tolerant. Thanks a lot for helping figure it out! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.