Symptoms:
- The unusually high number of downloads was observed in the CCD bucket.
- Downloads were observed despite providing a cached addressables directory with the game install.
- Player count remains low while downloads spike unexpectedly.
Cause:
- By default, the cache is kept for 150 days or 12960000 seconds
The cache expiration delay is causing addressable assets to be re-downloaded after a set period.
Resolution:
// Modern API (Unity 2021+)
Cache cache = Caching.currentCacheForWriting;
cache.expirationDelay = 12960000;
// Legacy API (Pre-2021)
Caching.expirationDelay = 12960000;
- Setting cache.expirationDelay = 0 will cause the cache to be removed on every load, which is not the desired outcome.
- If the cache expiration delay is set to 0, the cache will be invalidated and re-downloaded on every game load.
More information:
- The maximum expiration delay is 150 days (12,960,000 seconds).
- There is no permanent solution to prevent cache expiration beyond 150 days.
- A feature request has been made to allow caches that never expire.