Jump to content

Problem with manifest cache (new file version not downloaded)


Vousk-prod.
 Share

Recommended Posts

Hello you,

 

I'm using manifest files with my babylon scenes, but sometimes it doen't work correctly (or I misunderstand something).

I have a babylon scene file, version 1.

I put in manifest file (correctly nameed myscene.babylon.manifest) :

{ "version" : 1, "enableSceneOffline" : true, "enableTexturesOffline" : true }

Ok, my scene and textures are loaded and put in cache. I then can go offline to play with my scene.

 

Then I change my babylon file, and I also change my manifest file to :

{ "version" : 2, "enableSceneOffline" : true, "enableTexturesOffline" : true }

But the browser (firefox) is still using the old babylon scene in cache instead of loading the new one.

(I'm not using any other cache system in the website)

 

If I remove the manifest file, the new scene is correctly loaded. But then if I put again the manifest (even while incrementing version number), it is always the old scene file in cache that is used and not the new one.

 

(Of course if I clear cache, the new one is loaded and stored in cache, but I cannot ask internet users to empty their cache everytime is update my scene :P ).

 

Any idea, suggestion, similar problem ?

Link to comment
Share on other sites

Any news about that ?

 

I've just figured out another not really convenient behaviour with the cache system : the loading progress function (in BABYLON.SceneLoader.Load) is not called at all when the cached version is used. Even if objects and textures are in cache, for big scenes it takes time to compute and paint on screen, so to know the internet AND cache loading progress is equally usefull.

Link to comment
Share on other sites

  • 3 weeks later...

Sorry to "up", but a powerfull game engine as BJS, capable of loading and displaying efficiently large amount of 3d and textures data, with lots of marvelous functionnalities pushed in, but where we can't rely on a working caching system whereas it's targeted to be accessed on the internet... pretty difficult to use in production :'(

Link to comment
Share on other sites

I'm going to test that today. But you know, we don't deliver any kind of professional support as it's a personal project. We're spending a lot of energy fixing bugs reported by the community on our spare time. Don't hesitate to debug yourself the code available as open source. ;)

Link to comment
Share on other sites

Yes I know that ! I love the work you all do and I do not ask for any professional support. In fact I'm totally impressed by the work you manage to do in this project on your spare time.

My purpose is also to help community to be able to do great things with this engine.

For some points I just do not understand what your code is about, your game engine is a big stuff, not a simple piece of code, and I'm very new to javascript and HTML5 (and also I've never written a single line of typescript...) but when I can I'm trying my best to contribute.

Link to comment
Share on other sites

Hey guys, 

 

I think I found the problem, but please tell me what your think.

In the function _saveSceneIntoDBAsync, the system retrieve the scene by its URL with a XMLHttpRequest.

However, this request looks first for the a resource with the same URL in the browser cache if existing (https://developer.mozilla.org/es/docs/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache).

 

=> I think the new version of your scene is not loaded because the old one is retrieved from the browser cache.

 

In order to bypass the cache, a cross-browser compatible approach is to append a timestamp to the URL when calling the XMLHttpRequest, like this : 

url += (url.match(/\?/) == null ? "?" : "&") + (new Date()).getTime()

A pull request has been created https://github.com/BabylonJS/Babylon.js/pull/224

Meanwhile, Vousk-prod, can you tell me the version of babylon you're currently using ? I can build a custom version of babylon to check if this fix your problem.

 

Cheers !

Link to comment
Share on other sites

Very clever, what a responsive community ! :)

Currently I'm using the 1.12.beta for all of my scenes (because it's a very good version and only 406 Ko), but I will use 1.13.beta (and following versions) for new projects (good to be up to date in this kind of dev).

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

 I've finished completely rewriting babylon.database.js in TypeScript yesterday (which means that babylon.js is now 100% written in TypeScript! :)). I've added a couple of fix & enhancement. It contains the timestamp trick of Temechon & some bugs fix for Chrome that now support blob storage in IDB.

 

 This new version is a bit more robust than the previous one and you shouldn't have anymore the cache manifest problem. I now need to work on .DDS & .TGA support in the DB.

 

Bye!

 

David

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...