Skip to main content
Search our knowledge base

How do I delete AssetBundles from the cache?



  • Abhay Raghuwanshi


    We have a game in the market and we have been using WWW.LoadFromCacheOrDownload to download our asset bundles. Now the application data size is growing and we want to control it like the asset bundles not used since X time, should gets automatically deleted, so we tried to set Caching.expirationDelay (for testing we set it to 2 hours but we want it to 7 days in production), but Caching.expirationDelay seems not working at all.
    1. It doesn't remove the asset bundle older than Caching.expirationDelay time set by us.
    2. When we check the value of Caching.expirationDelay after each app restart, it always stays at "12960000"

    We want to clear out old assets (not used since 7 days) and also want to apply the same caching timeout for future assets. Can you suggest whats wrong being done by us!

    We are using unity 5.3.4p1
    And tested on Android phone and unity ediror.

  • Urs Clement

    Shouldn't it be Caching.ClearCache() ?

    public static void CleanCache ()
    if (Caching.ClearCache ())
    Debug.Log("Successfully cleaned the cache.");
    Debug.Log("Cache is being used.");

Article is closed for comments.