Parse-SDK-Android
Parse-SDK-Android copied to clipboard
Add proper LRU cache for ParseFile
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
Filemodification date for this on iOS) - Does not allow files larger than
MAX_CACHE_SIZEto 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
@natario1 is there any chance of you continuing to work on this, or shall I close it?
@Tom-Fox1 No, sorry! I remember this was blocked by something else but it's been a while since I contributed here last time. Looks like an important thing though