I use Memcache on my web server and sometimes I got an error like
java.lang.IllegalArgumentException: Key is too long (maxlen = 250)
I want to find some solution to decrease the length. Is it possible? I've read, that I can do that with sha 1 or something else.
For example in pseudocode
String key = server.getClient();
String value = server.getValue();
String sha1 = hash(key+value);
memcache.add(key,sha1);
Is it possible?
But I think it would cost much more than I wouldn't use cache for request with length more than 250 symbols, wouldn't it?