Parse-SDK-Android icon indicating copy to clipboard operation
Parse-SDK-Android copied to clipboard

Add proper LRU cache for ParseFile

Open grantland opened this issue 10 years ago • 2 comments

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

grantland avatar Sep 01 '15 22:09 grantland

@natario1 is there any chance of you continuing to work on this, or shall I close it?

TomWFox avatar Apr 03 '19 22:04 TomWFox

@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

natario1 avatar Apr 03 '19 23:04 natario1