diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-12-09 21:27:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-09 21:27:32 +0100 |
| commit | 5ce31d6a7142ca8c76d6b52fa42b3406b9a8ff48 (patch) | |
| tree | e1e99006ce06ced4175767998ba684e9dd0ee4b7 /docs | |
| parent | 2c5d6dc44779448de1497f32c925c96975fae461 (diff) | |
Fixed #32193 -- Deprecated MemcachedCache.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 3 | ||||
| -rw-r--r-- | docs/releases/3.2.txt | 5 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 39 |
4 files changed, 23 insertions, 26 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 06ea0fbbc0..b53552bb0a 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -29,6 +29,8 @@ details on these changes. * ``TransactionTestCase.assertQuerysetEqual()` will no longer automatically call ``repr()`` on a queryset when compared to string values. +* ``django.core.cache.backends.memcached.MemcachedCache`` will be removed. + .. _deprecation-removed-in-4.0: 4.0 diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 606ef98744..bfa62f1508 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -156,9 +156,8 @@ The cache backend to use. The built-in cache backends are: * ``'django.core.cache.backends.dummy.DummyCache'`` * ``'django.core.cache.backends.filebased.FileBasedCache'`` * ``'django.core.cache.backends.locmem.LocMemCache'`` -* ``'django.core.cache.backends.memcached.MemcachedCache'`` -* ``'django.core.cache.backends.memcached.PyLibMCCache'`` * ``'django.core.cache.backends.memcached.PyMemcacheCache'`` +* ``'django.core.cache.backends.memcached.PyLibMCCache'`` You can use a cache backend that doesn't ship with Django by setting :setting:`BACKEND <CACHES-BACKEND>` to a fully-qualified path of a cache diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt index 2ab8546026..d5047dfe60 100644 --- a/docs/releases/3.2.txt +++ b/docs/releases/3.2.txt @@ -660,3 +660,8 @@ Miscellaneous ``TransactionTestCase.assertQuerysetEqual()``, when compared to string values, is deprecated. If you need the previous behavior, explicitly set ``transform`` to ``repr``. + +* The ``django.core.cache.backends.memcached.MemcachedCache`` backend is + deprecated as ``python-memcached`` has some problems and seems to be + unmaintained. Use ``django.core.cache.backends.memcached.PyMemcacheCache`` + or ``django.core.cache.backends.memcached.PyLibMCCache`` instead. diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index ce9a982a23..66551fc8fe 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -77,18 +77,16 @@ database or filesystem usage. After installing Memcached itself, you'll need to install a Memcached binding. There are several Python Memcached bindings available; the -three most common are `python-memcached`_, `pylibmc`_, and `pymemcache`_. +two supported by Django are `pylibmc`_ and `pymemcache`_. -.. _`python-memcached`: https://pypi.org/project/python-memcached/ .. _`pylibmc`: https://pypi.org/project/pylibmc/ .. _`pymemcache`: https://pypi.org/project/pymemcache/ To use Memcached with Django: * Set :setting:`BACKEND <CACHES-BACKEND>` to - ``django.core.cache.backends.memcached.MemcachedCache``, - ``django.core.cache.backends.memcached.PyLibMCCache``, or - ``django.core.cache.backends.memcached.PyMemcacheCache`` (depending on your + ``django.core.cache.backends.memcached.PyMemcacheCache`` or + ``django.core.cache.backends.memcached.PyLibMCCache`` (depending on your chosen memcached binding) * Set :setting:`LOCATION <CACHES-LOCATION>` to ``ip:port`` values, @@ -97,21 +95,21 @@ To use Memcached with Django: ``path`` is the path to a Memcached Unix socket file. In this example, Memcached is running on localhost (127.0.0.1) port 11211, using -the ``python-memcached`` binding:: +the ``pymemcache`` binding:: CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': '127.0.0.1:11211', } } In this example, Memcached is available through a local Unix socket file -:file:`/tmp/memcached.sock` using the ``python-memcached`` binding:: +:file:`/tmp/memcached.sock` using the ``pymemcache`` binding:: CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': 'unix:/tmp/memcached.sock', } } @@ -129,7 +127,7 @@ address 172.19.26.240 and 172.19.26.242, both on port 11211:: CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': [ '172.19.26.240:11211', '172.19.26.242:11211', @@ -143,7 +141,7 @@ on the IP addresses 172.19.26.240 (port 11211), 172.19.26.242 (port 11212), and CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': [ '172.19.26.240:11211', '172.19.26.242:11212', @@ -165,6 +163,12 @@ particularly temporary. The ``PyMemcacheCache`` backend was added. +.. deprecated:: 3.2 + + The ``MemcachedCache`` backend is deprecated as ``python-memcached`` has + some problems and seems to be unmaintained. Use ``PyMemcacheCache`` or + ``PyLibMCCache`` instead. + .. _database-caching: Database caching @@ -452,19 +456,6 @@ of 60 seconds, and a maximum capacity of 1000 items:: } } -Here's an example configuration for a ``python-memcached`` based backend with -an object size limit of 2MB:: - - CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', - 'OPTIONS': { - 'server_max_value_length': 1024 * 1024 * 2, - } - } - } - Here's an example configuration for a ``pylibmc`` based backend that enables the binary protocol, SASL authentication, and the ``ketama`` behavior mode:: |
