summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Meers <simon@simonmeers.com>2011-09-21 01:33:14 +0000
committerSimon Meers <simon@simonmeers.com>2011-09-21 01:33:14 +0000
commitb22a4fdc710684e089fd6135ac4c94b51fea2a3e (patch)
tree31a085ef4c0b7b2b523173234991664581d1e766 /docs
parentaaf77c1676e44019abe544911ff7a06eb2690295 (diff)
Fixed #16886 -- Memcached socket file documentation. Thanks ddbeck for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/cache.txt15
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index d3fa888f48..709e1f542a 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -100,8 +100,9 @@ To use Memcached with Django:
on your chosen memcached binding)
* Set :setting:`LOCATION <CACHES-LOCATION>` to ``ip:port`` values,
- where ``ip`` is the IP address of the Memcached daemon and
- ``port`` is the port on which Memcached is running.
+ where ``ip`` is the IP address of the Memcached daemon and ``port`` is the
+ port on which Memcached is running, or to a ``unix:path`` value, where
+ ``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::
@@ -113,6 +114,16 @@ the ``python-memcached`` binding::
}
}
+In this example, Memcached is available through a local Unix socket file
+:file:`/tmp/memcached.sock` using the ``python-memcached`` binding::
+
+ CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+ 'LOCATION': 'unix:/tmp/memcached.sock',
+ }
+ }
+
One excellent feature of Memcached is its ability to share cache over multiple
servers. This means you can run Memcached daemons on multiple machines, and the
program will treat the group of machines as a *single* cache, without the need