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?
Hi @haling79 yes starting in 2022.1+ WebGL bundles use the browser cache instead of the UnityEngine.Caching class. In this case GetDownloadSizeAsync does not know if the bundle is cached.
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?
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.
We ended up forking the Addressables package and modifying the code so that the catalog hash is stored and survives the page reload. We have needed to do considerable amount of bug fixes and changes to get the system to behave predictably in our game where the catalog is being updated frequently.