﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6447	cache backends that are primarily for local dev should enforce same key restrictions as memcached	nicois <nicois.nicois@…>	Carl Meyer	"Using a locmem:// or postgres cache backend, I can generate a cache key using the following expression:
{{{ repr(f.__module__) + repr(f.__name__) + repr(args) + repr(kwargs) }}}
but if I configure memcached, it fails silently, causing an empty page to be sent to the client.

I have confirmed this is the source of the problem by generating an md5.hexdigest of the above key - in which case, memcached works correctly.

I have included the context for the above key, in case it is relevant. It is a decorator method which caches the return value of an arbitrary function, assuming its value depeonds solely on its parameters, and that the method never returns None

{{{
from django.core.cache import cache as _djcache
def cache(seconds = 3600):
    def doCache(f):
        def x(*args, **kwargs):
                key = md5(repr(f.__module__) + repr(f.__name__) + repr(args) + repr(kwargs)).hexdigest()
                result = _djcache.get(key)
                if result is None:
                    result = f(*args, **kwargs)
                    _djcache.set(key, result, seconds)
                return result
        return x
    return doCache
}}}
"		closed	Core (Cache system)	dev		fixed	memcached sprintSep2010		Accepted	1	0	0	0	0	0
