A typical workaround is to to take a hash (md5 or similar) of the filename and then pick some number of nested directories to store it in.
Like: md5("data-file-one") == "0278c2451c1cd1dd98815260159c44e0"
Assuming you go with 4 levels, then:
mkdir -p "0/2/7/8/c" && mv data-file-one 0/2/7/8/c/data-file-one
I believe apache's mod_cache takes this approach.