docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CleanBundleCache

    CleanBundleCache(IEnumerable<string>)

    Removes any AssetBundles that are no longer referenced in the bundle cache. This can occur when a new, updated catalog excludes entries present in an older catalog.

    Declaration
    public static AsyncOperationHandle<bool> CleanBundleCache(IEnumerable<string> catalogsIds = null)
    Parameters
    Type Name Description
    IEnumerable<string> catalogsIds

    The ids of catalogs whose bundle cache entries we want to preserve. If null, entries for all currently loaded catalogs will be preserved.

    Returns
    Type Description
    AsyncOperationHandle<bool>

    The operation handle for the request. Note, that it is user's responsibility to release the returned operation; this can be done before or after the operation completes.

    Remarks

    Note, that only AssetBundles loaded through UnityWebRequest are cached. If you want to purge the entire cache, use Caching.ClearCache instead. In the Editor CleanBundleCache should only be called when using the "Use Existing Build (requires built groups)" playmode script as it loads content from bundles.

    See AssetBundle caching for more details.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)