I need to store assetbundle downloaded with UnityWebRequest, so that I don’t have to re-download it every time I start the game. However, I want to remove assetbundle, that was not used for certain amount of days.
Therefore, I implemented Caching system. Downloading and loading from local storage works fine, but I can’t find a way to set timer for deleting assetbundle. I tried Cache.expirationDelay, which seemed as the right way to do it, but it doesn’t work as expected. If I create and add a new Cache and set its expirationDelay to e.g. 20, download assetbundle and then restart the app, this code block:
Cache existingCache = Caching.AddCache(existingCachePath); Debug.Log(existingCache.expirationDelay);
Prints default expirationDelay value - 12960000, even though the folder with assetbundle is already created.
Is there any other way that I can find out when was the Cache created, or assetbundle most recently downloaded?