'Test that a key is memcache-compatible.
Based on Django\'s validator in core.cache.backends.base'

def _is_valid_key(self, key):

    if (len(key) > 250):
        return False
    for char in key:
        if ((ord(char) < 33) or (ord(char) == 127)):
            return False
    return True
