# Unity mobile game generates too much cache

I have built a game I have been working on for Android (Unity). It's a simple game: air hockey. It weights 21mb with all the assets and scripts.

After playing for a bit I have noticed that cache of the game is growing very fast and probably infinitely (to use all phone memory). The game itself takes 43.20mb installed. But cache for me right now is 80mb.

I have similar games installed and they take up to a 6mb max. And definitely, the cache is growing slower for them.

Previous games that I have developed doesn't have this issue. For example, the game that takes 80mb disk space has only 532KB of cache and it's not growing.

I thought of manually clearing the cache every time player leaves the game. I haven't found any relative information on how to do that in unity, but that is probably even not the right way to do it. All I have found is how to delete GI cache... and the google search doesn't show anything relevant.

How can I track what is creating so much cache? Is there an easy way to do it within Unity? Or how can I request cache deletion from code?

• If your edits have solved your problem, please feel free to post them as an answer that you can later mark Accepted. :). Just don't clear your cache too aggressively — lots of phone users have more storage than data bandwidth in a month, so when an ad can play from cache instead of re-downloading that can be kinder to their data plan, even if it costs a bit of revolving storage. – DMGregory Oct 11 '17 at 13:43

You can delete cache using Caching.ClearCache(); inside Unity - it will delete all the cache created by the application.