Open
Description
Right now we throw everything into Android's cache directory and don't really do anything to clean it up. We're adding File
APIs to allow developers can manage the cached files, but it'd be great to follow Android's recommendations when utilizing the cache directory ourselves.
What we'd need to do is have a cache manager that:
- Clears all staging (
.tmp
) files on launch - Keeps track of files that have been least recently used (we use
File
modification date for this on iOS) - Does not allow files larger than
MAX_CACHE_SIZE
to be stored in the cache - Evicts files in the cache that have been least recently used when total size of the cache goes above
MAX_CACHE_SIZE