[patch] memcached backend can't use keys containing spaces
|Reported by:||Owned by:||Jacob|
|Component:||Core (Cache system)||Version:||master|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I wanted to use memcached to cache pages whose URLs contain spaces, but was told 'Client.MemcachedKeyCharacterError, "Control characters not allowed"'. The memcache module refuses to use keys longer than 250 characters or containing "control characters", which it defines as anything with a decimal ASCII code below 33 -- which includes the space character.
So the attached memcached backend uses a hash (SHA1) of the URL as the cache key as necessary. Seems to perform OK in my limited seat-of-the-pants usage; I suppose urllib.quote might be faster, but wouldn't help with long URLs.
Change History (4)
comment:1 Changed 10 years ago by
|Summary:||memcached backend can't use keys containing spaces → [patch] memcached backend can't use keys containing spaces|