Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug 2019.3 wasm caching and chrome

Discussion in 'WebGL' started by Racines, Dec 16, 2020.

  1. Racines

    Racines

    Joined:
    Jan 20, 2014
    Posts:
    31
    Hi,

    I recently made a build for webgl using the option "WebAssembly Streaming".
    It work well on every browser I tested.

    But when I updated the build (and so updated the "wasm" file), Chrome did not reload it from the local server but each time retrieve it from cache instead and even when I use the Shift + f5 to force refresh with no cache.
    On other browser this work as expected, they detect wasm file has changed and dowload it again.

    When I use chrome in private mode or if I manually modify the name of the wasm file, then Chrome download it and the app works well, so it's clearly related to the cache.

    I also join you two screenshot of the network tool of Chrome that show for each files if they were dowloaded from cache or not.
    When I press F5 only we see that almost all the files are retrieved from the disk cache:
    WasmWithoutForceRefresh.JPG

    When I press Shift + F5 we can see every files are downloaded except for the wasm file that still retrieved from disk cache
    WasmForceRefresh.JPG



    Is this problem come from Unity build? or Chrome?

    More info:
    Unity version: 2019.3.13f1
    Chrome version: 87.0.4280.88
     
  2. AgnosiaGames

    AgnosiaGames

    Joined:
    May 26, 2020
    Posts:
    57
    If on player settings "data caching" is active. Unity will use cached file. Chrome didn't cache this file.
     
  3. Racines

    Racines

    Joined:
    Jan 20, 2014
    Posts:
    31
    Ok thanks for the information @AgnosiaGames.
    So in this case the bug comes from Unity side but only on Chrome, this is weird
     
    AgnosiaGames likes this.
  4. Racines

    Racines

    Joined:
    Jan 20, 2014
    Posts:
    31
    I finally understood that the build settings "data caching" should be disable to let the server/browser cache work as expected.
    I was assuming if data chaching was disable it was reloading from server each time, but absolutly not. As @AgnosiaGames pointed it out when this option is enable it's unity that handle the caching file. In some case this is what we want but not in general.

    More info about how work the cache settings can be found here: https://forum.unity.com/threads/webgl-settings-data-caching.322559/#post-2512686
     
    AgnosiaGames likes this.