JakeWharton / DiskLruCache

Java implementation of a Disk-based LRU cache which specifically targets Android compatibility.
http://jakewharton.github.io/DiskLruCache
Apache License 2.0
5.79k stars 1.18k forks source link

Add public method to request the disk cache to cleanup #61

Open daj opened 10 years ago

daj commented 10 years ago

Applications may need to explicitly request a disk cache cleanup in some circumstances.

For example in our application we detect if the device hits an exception due to being very low on disk space, and if it is we reduce the size of our disk cache and immediately tell it to discard some files. Doing that our application will be functional until there is no more space to release from our internal directories.

(We did originally create a PR for this, but we accidentally closed it: https://github.com/JakeWharton/DiskLruCache/pull/50)