Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug In 2022.2.xx WebGL builds, GetDownloadSizeAsync does not reflect the cache.

Discussion in 'Addressables' started by haling79, May 25, 2023.

  1. haling79

    haling79

    Joined:
    Feb 17, 2023
    Posts:
    1
    We were using unity 2021.3.2 and recently upgraded to 2022.2.18.
    addressables@1.21.12 also upgraded to the latest version

    In WebGL builds, the previously working GetDownloadSizeAsync is not returning a zero result, even though it is already cached.

    We are currently trying to determine if GetDownloadSizeAsync should be used to download the bundle or not.

    But if we use DownloadDependenciesAsync, we get
    "[UnityCache] 'https://xxxxxxxxxxxxxxx/abc.bundle' successfully revalidated and served from the indexedDB cache", we can see that it's reading from the cache without actually downloading.

    I know that 2022.2.18 changed the indexedDB structure, so maybe GetDownloadSizeAsync doesn't reflect the cache?

    I ask for help.
     
  2. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
  3. sasuke9410

    sasuke9410

    Joined:
    Oct 8, 2020
    Posts:
    5
    Hi @pillakirsten
    We too were using the return value of the GetDownloadSizeAsync method to determine if there is a cache.
    Is there any way to check if there is a browser cache other than the GetDownloadSizeAsync method?

    Environment:
    Unity 2022.3.2f1
    WebGL platform
    Addressables 1.21.12
     
    gooby429 likes this.
  4. Chlebovic

    Chlebovic

    Joined:
    Aug 3, 2023
    Posts:
    1
    some updates? I found that bug also 2023.1.16f1..
     
  5. SampsaPlaysome

    SampsaPlaysome

    Joined:
    Oct 20, 2019
    Posts:
    34
    We have the same issue. Not only GetDownloadSizeAsync returns full download size (as if nothing was in cache), it sometimes returns double of that (when our game reloads, for example).

    On top of that, Addressables does not know when catalogs change on remote because it doesn't store the local hash for the catalog file. We had some code that acted differently when catalogs were updated, to unload all AssetBundles that were in use to be able to reload the catalog with updated bundles.

    Nowhere in the release notes (Addressables or Unity editor) or documentation this is mentioned. So basically there is a completely broken feature for WebGL... which I think is one of the main platforms for Addressables as you really want to minimize the bootstrap player and download all assets on the background...

    We can live with the GetDownloadSizeAsync being broken for WebGL, but the catalog issue is quite annoying to circumvent.
     
  6. timothyhermawan

    timothyhermawan

    Joined:
    Feb 23, 2019
    Posts:
    6
    Hey guys. Did you find the fix for this?
    Thank you