We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Force new version of .gltf every time page is refreshed

Home Forums Programming Force new version of .gltf every time page is refreshed

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #55245
    carlsky
    Participant

    Hello!
    I am working with different scenes in .gltf.xz and the browser is caching it, so when I am uploading new .gltf.xz – browser get the old file from cache (only browser cache clear works for now).

    I was trying to add .ver=?rand() on line 15:
    var sceneURL = params.load ? params.load : '__URL__plot_render.gltf'.replace('__URL__', '');
    but there is an error after doing it this way.

    How to properly force the app to load new .gltf.xz every time ?

    :bye:

    #55247
    kdv77kdv
    Participant

    var sceneURL = params.load ? params.load : '__URL__myAwesomeApp.gltf'.replace('__URL__', '') + '#' + Date.now();

    #55325
    carlsky
    Participant

    It works only for .gltf and not for .gltf.xz (compressed asset)
    It produces the path: ‘my_awesome_app.gltf#2708202223.xz’ :negative:

    I was trying to find the lines for compressed .xz assets, but with no avail.

    #55326
    kdv77kdv
    Participant

    It produces the path: ‘my_awesome_app.gltf#2708202223.xz’

    Well, that’s because .xz is added later )))
    sceneURL = initOptions.useCompAssets ? sceneURL + '.xz' : sceneURL;

    You can add one more line after the line above
    sceneURL = sceneURL + '#' + Date.now();

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.