Need some help on LoadFromCacheOrDownload()

Hi

Our game requires a system that downloads any new content from the net and uses it in game. I am using LoadFromCacheOrDownload() for it.

It works fine … it downloads my content and all is good till here.

Now ideally when once the content is downloaded it should not download again. But that is happening with me. On my PC I can see the cached assetBundle getting deleted from the cache folder when I run the game again and then it downloads again. This also happens on my iOS Devices.

How do I restrict that ?

here is the code that I am using…

	private IEnumerator load(string url, int version) 
	{
	    // wait for the caching system to be ready
	    while (!Caching.ready)
	      yield return null;

	    // load AssetBundle file from Cache if it exists with the same version or download and store it in the cache
		if(Caching.IsVersionCached(url, 1) == false)
		{
			www = WWW.LoadFromCacheOrDownload(url, version);
			yield return www;
			Debug.Log("Downloading again");
		}
		else
		{
			Debug.Log("Downloading again is not required....already in cache");
		}

	    Debug.Log(" Loaded ");

	    if (www.error != null)
	      throw new Exception("WWW download had an error: " + www.error);
    
	    AssetBundle assetBundle = www.assetBundle;
		AssetBundleRequest request = assetBundle.LoadAsync ("myObject", typeof(GameObject));
		yield return request;

		if(request.isDone == false)
		{
			//request.allowSceneActivation = true;
		}
		else
		{
			GameObject myObj = assetBundle.mainAsset as GameObject;
			Instantiate(myObj);
			//request.allowSceneActivation = false;
		}
	
        // Unload the AssetBundles compressed contents to conserve memory
    	assetBundle.Unload(false);
  	}

The cache is pretty small, so I imagine that you’re filling the cache up and it’s deleting old assets to make space for the new ones. You can buy a larger cache.

Sorry but I didn’t get what you are trying to say…

My point is if I have downloaded an assetBundle from my server to the device, it should be there with me for further use.
And Can I not save it?

Consider this assetbundle as an Upgrade to a weapon used in my game.

Asset bundles are compressed when they are transferred to your computer, but stored uncompressed in the cache. If the cache fills up, then Unity will delete the oldest asset bundle to make space for new bundles. And doesn’t Unload() remove the asset bundle from the cache?