App Cache Duration

Hey team

Just a quick one. Im building an app that will be open 24/7/365, and utilising Expo Camera as part of it to take photos every so often. I’m worried about the app cache gradually growing in size over time. How often is the app cache cleared by RN or the device? Is this something I need to worry about?

Thanks!
H

Hey @harveyappleton! React Native and Expo both don’t delete files from the cache directory, that is up to the OS.

Neither Android nor iOS specify exactly when they will clear the cache, hence the recommendation that any vital files be saved in another directory (like the DocumentDirectory). I believe that the larger your app’s cache directory, the more likely the OS will delete files from your app’s cache when it needs to make disk space.

Thanks mate, that’s super helpful. So not for me to worry about then, despite it being a 24/7/365 running app?

I can’t really say, it depends on your use case and what happens if the OS clears the cache. If that would completely break the app, then you should worry about it :sweat_smile: