Skip to content

Add ability to delete cache #568

@electrum-bowie

Description

@electrum-bowie

Cesium caches all 3D tiles on local app storage without ever deleting them, this means that it adds up from 0 all the way to 10gb quite quickly.

My script:

void OnApplicationQuit()
    {
        Caching.ClearCache();
        Directory.Delete(Application.temporaryCachePath, true);
        //-

        string cacheDir = Application.temporaryCachePath;
        string[] filesToDelete =
        {
            "cesium-request-cache.sqlite",
            "cesium-request-cache.sqlite-shm",
            "cesium-request-cache.sqlite-wal"
        };

        // Loop through the files and delete them
        foreach (string fileName in filesToDelete)
        {
            string filePath = Path.Combine(cacheDir, fileName);

            // Check if the file exists before attempting to delete it
            if (File.Exists(filePath))
            {
                // Delete the file
                File.Delete(filePath);
            }
        }
    }

Doesn't clear up that occupied space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions