optional, defaults to 250, which is the max length of a Memcached key
optional, defaults to an underscore
Convert the given string to a valid Memcached key by:
Convert the given string to a valid Memcached key by:
From the Memcached protocol spec:
Data stored by memcached is identified with the help of a key. A key is a text string which should uniquely identify the data for clients that are interested in storing and retrieving it. Currently the length limit of a key is set at 250 characters (of course, normally clients wouldn't need to use such long keys); the key must not include control characters or whitespace.
Because of the structure of cache keys, the most useful information is likely to be at the right hand end, so truncation is performed from the left.
Sanitizer that replaces characters invalid for Memcached and truncates keys if they are over a certain limit.
Convenient because it creates human-readable keys, but only safe for ASCII chars.
optional, defaults to an underscore
optional, defaults to 250, which is the max length of a Memcached key