Assetbundle version number

I have been looking around for an answer to this question but I haven’t been able to find any meaningful answer.

My app has cached an assetbundle that I downloaded from my server. In the meantime I have updated that assetbundle on the server. My question is, how can the app know that a newer version of an assetbundle is available? Is there any simple way to know? Do I have to keep an extra file with a version number along with my assetbundle and check the version from that file to know that the bundle has been updated?

When downloading an AssetBundle Unity will check if the file already exists in the cache. If it does, it compare the version of the stored asset with the version requested. If it is different then the AssetBundle will be redownloaded. If it`s the same, then it will load the AssetBundle from disk and avoid having to redownload the file. Please refer to the WWW.LoadFromCacheOrDownload function in the scripting reference for more information about these parameters.

Just try to download the file and when its a new version → You will get it.

So what the Scripting API will make you believe is that the hash values generated during the asset bundle build process will work. That would be very nice. Then you could save and download the AssetBundleManifest. It has a method called GetAssetBundleHash that will return the hash value given an asset bundle’s name. This hash value could then be used as the version number when loading the bundle on the client device. But Unity has documentation stating that these hash values are unreliable and not to be used for versioning purposes. And this is consistent with my experience; I have many times seen Unity using the same hash value for bundles that are slightly different. This leaves me wondering what their hash values are for.

It seems we are left to make our own hash/version numbers then. I know the original post here is dated, but I should mention that the preferred way to load asset bundles now comes from UnityWebRequest, not WWW. But yeah, you are left to print the latest versions to some file and upload to server. Or you could include this configuration with player if it weren’t large.