As sprockets would use the encoded file path as file name for temp files,
these filenames can become very long if the number of sub directories is high.
This becomes a problem on linux filesystems as the filename limit is 255 characters.
I originally posted an issue in rails:
use hash instead of encoded file path as file name for temp files
Rails's old store used to create directories for / instead of escaping them.
Memcache keys also need to be under 250c. So maybe this is a good idea. Probably going to make shit harder to debug though.
It's probably a bit faster not to create subdirectories. Is there anything else I should add to this pull request?
Lets keep cache_key_namespace in the key. So generate sprockets/098f6bcd4621d373cade4e832627b4f6.
added cache_key_namespace to cache key
Hash cache key to avoid exceeding 250c