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

Total number of files limit of FAT filesystem #76

Open yuwentw opened 9 years ago

yuwentw commented 9 years ago

In FAT filesystem, which is the default filesystem for external SD Card, we can only store around 15 ~ 20k files in a directory. In most cases, it shouldn't be a problem. But when I need to cache a lot of small images with DiskLruCache, it brings this issue to me.

Hence, I would like to know if it's possible to create the sub-directory within DiskLruCache's cahce directory so we can solve this issue for good.

FAT filesystem limit information: http://stackoverflow.com/questions/2651907/is-there-a-limit-for-the-number-of-files-in-a-directory-on-an-sd-card

clyang commented 9 years ago

Having the same issue here. Luckily enough my Android app is for internal usage only so I can ask my users to use exFAT to avoid this issue.

JakeWharton commented 9 years ago

A possible solution as part of #71 we could relax key restrictions and allow specifying hierarchical keys which would allow you to partition your keys based on some prefix (even if it's just the first two characters of an MD5 for example).