Remove the old URI syntax for cache backends. #1642

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

funkybob commented Sep 19, 2013

In preparation for building the "new" thread safe, non-duplicating cache API, I'm removing the old URI syntax for caches in the hopes of cleaning up before we make a mess.

@timgraham timgraham commented on an outdated diff Sep 19, 2013

django/core/cache/__init__.py
@@ -8,8 +8,8 @@
Client code should not access a cache backend directly; instead it should
either use the "cache" variable made available here, or it should use the
-get_cache() function made available here. get_cache() takes a backend URI
-(e.g. "memcached://127.0.0.1:11211/") and returns an instance of a backend
+get_cache() function made available here. get_cache() takes a CACHES alias
@timgraham

timgraham Sep 19, 2013

Owner

good opportunity to add `` around get_cache() and CACHES

@timgraham timgraham commented on an outdated diff Sep 19, 2013

django/core/cache/__init__.py
@@ -8,8 +8,8 @@
Client code should not access a cache backend directly; instead it should
either use the "cache" variable made available here, or it should use the
-get_cache() function made available here. get_cache() takes a backend URI
-(e.g. "memcached://127.0.0.1:11211/") and returns an instance of a backend
+get_cache() function made available here. get_cache() takes a CACHES alias
+or a backend path and config params, and returns an instance of a backend
@timgraham

timgraham Sep 19, 2013

Owner

params -> parameters

@timgraham timgraham commented on the diff Sep 19, 2013

django/core/cache/__init__.py
@@ -114,17 +53,24 @@ def get_cache(backend, **kwargs):
"""
try:
- if '://' in backend:
@timgraham

timgraham Sep 19, 2013

Owner

I'm not sure this can be removed without a proper deprecation. In any case, it needs a ticket.

@funkybob

funkybob Sep 19, 2013

Contributor

I discussed this with Florian... the syntax was removed from the docs 3 years ago when RKM added multi-cache support:
673e6fc#diff-a7f182984504962fb780894ba7d4746e

@timgraham timgraham commented on an outdated diff Sep 19, 2013

django/core/cache/__init__.py
@@ -8,8 +8,8 @@
Client code should not access a cache backend directly; instead it should
either use the "cache" variable made available here, or it should use the
-get_cache() function made available here. get_cache() takes a backend URI
-(e.g. "memcached://127.0.0.1:11211/") and returns an instance of a backend
+``get_cache()`` function made available here. get_cache() takes a CACHES alias
@timgraham

timgraham Sep 19, 2013

Owner

how about applying the get_cache() change to the second occurrence on the line and adding :setting: to CACHES

@timgraham timgraham commented on an outdated diff Sep 19, 2013

docs/releases/1.7.txt
@@ -414,6 +414,10 @@ Miscellaneous
Rationale behind this is removal of dependency of non-contrib code on
contrib applications.
+* The old cache URI syntax is no longer supported. It still worked, even
@timgraham

timgraham Sep 19, 2013

Owner

given an example of the syntax?

@timgraham timgraham commented on an outdated diff Sep 19, 2013

docs/releases/1.7.txt
@@ -414,6 +414,10 @@ Miscellaneous
Rationale behind this is removal of dependency of non-contrib code on
contrib applications.
+* The old cache URI syntax is no longer supported. It still worked, even
+ though it was not documented or officially supported. If you're still using
+ it, please update to the current CACHES dict syntax.
@timgraham

timgraham Sep 19, 2013

Owner

:setting:CACHES

@timgraham timgraham commented on the diff Sep 19, 2013

django/core/cache/__init__.py
@@ -8,9 +8,9 @@
Client code should not access a cache backend directly; instead it should
either use the "cache" variable made available here, or it should use the
-get_cache() function made available here. get_cache() takes a backend URI
-(e.g. "memcached://127.0.0.1:11211/") and returns an instance of a backend
-cache class.
+``get_cache()`` function made available here. ``get_cache()`` takes a CACHES
@timgraham

timgraham Sep 19, 2013

Owner

sorry, I missed that this was a comment and not documentation so I'm going to remove the ``

Owner

timgraham commented Sep 19, 2013

merged in 4e9f800 - thanks!

timgraham closed this Sep 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment