Memcached server has limitation for key length (250 characters). We currently do MD5 hash as a workaround. This could be an issue:
- performance (MD5)
- multiple keys with same hash
Possible solution:
- create hash only for long keys
- Would could retrieve item from cache based on hash. Then check real cache key which would be store as part of cached value.
- A] save an uncacheable item for all other keys with the same hash (acceptable only if such long keys would be an exception + log warning)
B] save set of all items with the same hash into cache (save with the lowest TTL from all of them, could be a problem with size limitations - default 1MB)