I see the version of the parameters of LoadFromCacheOrDownload

Environment: win10, unity2018, vs2015

Recently worked on ab package
has several loading modes, one of which is

WWW.LoadFromCacheOrDownload(string url, int version)

url is the address of ab package, version is the version number of
the problem lies in this version

See the official documents did not say clearly this is where the version number, used to do

Search and the use of a lot, only to find out about

First of all, this version is not the version number recorded in the ab package file, such as the corresponding manifest files
that come from it

Actually very simple, this version number is assigned to the developers themselves.

The local assignment is precisely this code

WWW.LoadFromCacheOrDownload(string url, int version);

That is, when you use this statement to load the package, such as we set the version 2
system will judge you have not loaded locally about this package, yes, look at the version of the package is not loaded through 2
if no version number , from 2 to url address to download a local cache, and cache numbers to this a version, that is, 2

This is a trial I do webgl program
that is, if you open your webgl project for the first time in a browser, you gave a version number in the above statement is a load 2, that see the local browser no cache will go to the download url address and 2 as the version number assigned to this cache. Open the next time, if the program has not changed, the version number is 2, then the local had previously downloaded and cached version 2, the program will not download url at, but directly read the local cache. This is the meaning of it lies the cache.

So next time you turn, and the version number of requests changed to 3, the same token, there is no local cache program to determine the version number is 3, and the same again at the url to download from local deposit into another cache, and do give it 3 is the version number

In summary, when you come to request a version number, the program (browser) will look at the existing local cache, if you already have a version number of this cache is read directly from the local cache, if not from the url at download, save to a local, giving the version number of this request

So before the maximum number of this version is tangled in the end is where to set up, in fact, that argument when requested for download.
In addition, as mentioned above, if you load a different version numbers too, so there will in fact not just a local cache.

Guess you like

Origin blog.51cto.com/shuxiayeshou/2414979