#15815: Support memcached binary protocol in PyLibMCCache
-------------------------------------+-------------------------------------
     Reporter:  mtigas               |                    Owner:
         Type:  New feature          |                   Status:  closed
    Component:  Core (Cache system)  |                  Version:  1.3
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:  sprint2013           |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  1                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by edmorley):

 * status:  new => closed
 * cc: emorley@… (added)
 * resolution:   => duplicate


Comment:

 This has been fixed in ticket #20892, by adding generic support for
 passing parameters through to the memcached client constructor (and for
 all backends, not just `PyLibMCCache`).

 pylibmc's constructor is:
 {{{#!python
     def __init__(self, servers, behaviors=None, binary=False,
                  username=None, password=None):
 }}}

 So on Django master (will be 1.11), binary mode can be enabled using eg:
 {{{#!python
 CACHES = {
     'default': {
         'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
         'LOCATION': '127.0.0.1:11211',
         'OPTIONS': {
             'binary': True,
             'username': 'user',
             'password': 'pass',
             'behaviors': {
                 'ketama': True,
             }
         }
     }
 }
 }}}

 For more examples, see:
 https://docs.djangoproject.com/en/dev/topics/cache/#cache-arguments

 I'm going to try and backport these changes (plus ticket #27152) to
 django-pylibmc, so the same Django settings file will work for both, to
 make transitioning from "older Django+django-pylibmc backend" to "Django
 1.11+ with stock backend" easier.

--
Ticket URL: <https://code.djangoproject.com/ticket/15815#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.560e02215cf9b80c7a88c994061eea7b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to