Opened 8 years ago
Closed 8 years ago
#27152 closed Cleanup/optimization (fixed)
Comma-delimited servers list not supported in memcached caches `LOCATION`
Reported by: | Ed Morley | Owned by: | Ed Morley |
---|---|---|---|
Component: | Core (Cache system) | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | emorley@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently Django's memcached backends only support a semicolon delimited servers list in the cache config, such as:
CACHES = { 'default': { 'LOCATION': 'server1.foo.com;server2.foo.com', }, }
This is because the backend just does:
self._servers = server.split(';')
However cloud memcached offerings such as Memcachier and Memcached Cloud typically use a comma-delimited list in the automatically set environment variable, eg:
MEMCACHIER_SERVERS='foo.us-east-5.heroku.prod.memcachier.com:11211,bar.us-east-5.heroku.prod.memcachier.com:11211'
Given that the caches LOCATION
parameter contains only domain name and port (and not say passwords), it should never contain a comma - so we should be fine to also split on them too.
Change History (7)
comment:1 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Bug → Cleanup/optimization |
comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 8 years ago
Owner: | changed from | to
---|
Ah I have this finished locally already - sorry thought I'd set the ticket assignee already!
I guess
server.replace(',', ';').split(';')
should work.