Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Any way to delete cached asset bundle without deleting all the cache?

Discussion in 'Editor & General Support' started by Acrilige, Feb 20, 2016.

  1. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    Let's assume I have a bundle which weights like 100mb, and it might be updated on server. If it gets updated, a client re-downloads it (using WWW.LoadFromCacheOrDownload with a new version number). After a client finishes downloading, it knows for certain that previous version will no be longer needed and it can delete it (otherwise it will consume that 100mb for Caching.expirationDelay seconds). I can't set expiration delay to some low number since it will affect other bundles as well.

    Is there any way to delete it without deleting ALL the cache using Caching.CleanCache?
     
  2. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    Still interested in that :)
     
  3. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    Yep yep, still interested. Anyone?
    This seems to be a big flaw in caching system
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,332
    I guess this is something that was never implemented using Unity's caching system.

    We just started working with asset bundles ourselves, and due to a number of reasons chose to implement our own caching mechanism. You could do the same yourself, starting bare bones with only a simple mechanism for storing the downloaded content to a folder on the device. This gives you access to managing the cache yourself (purging unneeded content, setting different policies for retaining data in cache,etc).
     
  5. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    Yep, seems thats the only way to go. Pretty sad, though
     
  6. Vincent-Zhang

    Vincent-Zhang

    Unity Technologies

    Joined:
    Jan 23, 2013
    Posts:
    106
    It's the feature we already planned, will get you guys updated.
     
  7. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
  8. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    157
  9. Fotofobia

    Fotofobia

    Joined:
    Mar 31, 2017
    Posts:
    10
    I need to clear the assetbundle cache --- any ideas / follow up on this topic?
     
  10. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,332
    Create your own cache mechanism where you'll have total control over everything.
     
  11. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    Just do it yourself is rarely a viable solution with any sort of time pressure... it's why we use an engine.
    Plus, clearing a single reference from cache is an obvious necessity of a caching system.