This is a good feature and I also have my custom cache backend with project-level key prefixes. It was easy to implement and doesn't require changes in django core. But if this backend is in django core (that's a good idea) then some other changes should be done. There will be 2 similar options after this change: CACHE_MIDDLEWARE_KEY_PREFIX and PROJECT_CACHE_PREFIX. I think the patch should deprecate CACHE_MIDDLEWARE_KEY_PREFIX and maybe overhaul key_prefix arguments (and their defaults) to make the code cleaner.
On Jun 19, 4:46 am, Byron <bjr...@gmail.com> wrote: > Opened a ticket and added my patch..http://code.djangoproject.com/ticket/13795 > > On Jun 15, 7:15 pm, Giuseppe Ciotta <gcio...@gmail.com> wrote: > > > > > On Wed, Jun 16, 2010 at 1:04 AM, Giuseppe Ciotta <gcio...@gmail.com> wrote: > > > On Wed, Jun 16, 2010 at 12:46 AM, Jeremy Dunck <jdu...@gmail.com> wrote: > > >> On Sun, Jun 13, 2010 at 7:18 AM, lenz <lenzhir...@googlemail.com> wrote: > > >>> Could you share your code with us? > > >>> Thanks you! > > > >> This might help: > > >>http://gist.github.com/425403 > > > > I have some similar code here:http://gist.github.com/439868 > > > > It might be better because it wraps an arbitrary cache backend adding > > > prefix handling, it's not limited to memcache. > > > Uhm,http://gist.github.com/425403doesindeed support an arbitrary > > backend, there's just a call to _get_memcache_timeout() which should > > be changed in order to make it completely backend agnostic. I left > > "*args, **kwargs" signatures everywhere to avoid dealing with > > parameters. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.