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

Increase key length limit to 120. #65

Closed acherkashyn closed 10 years ago

acherkashyn commented 10 years ago

Increase the key length limit and update unit tests accordingly.

JakeWharton commented 10 years ago

I'm wondering if enforcing a length is useful at all. @swankjesse?

swankjesse commented 10 years ago

If we were ever to switch to a binary encoding, we'd want a length limit like 255 so we can store the length in a single byte. And because the key name is used as a filename we shouldn't let it go arbitrarily long.

But 120 should be fine.

gubatron commented 10 years ago

really cool observation @swankjesse (in that case just raise it now to 255 then)

JakeWharton commented 10 years ago

The file name limit is 127 on Android. 120 is good. On Jul 22, 2014 6:49 PM, "Angel Leon" notifications@github.com wrote:

really cool observation @swankjesse https://github.com/swankjesse (in that case just raise it now to 255 then)

— Reply to this email directly or view it on GitHub https://github.com/JakeWharton/DiskLruCache/pull/65#issuecomment-49824194 .

acherkashyn commented 10 years ago

So then... merge? :)

JakeWharton commented 10 years ago

Squashed and merged.