@@ -14,6 +14,25 @@ django-cache-url
1414 :target: https://github.com/epicserve/django-cache-url/actions
1515 :alt: Tests
1616
17+ ⚠️ Important Notice for Redis Users
18+ ------------------------------------
19+
20+ **If you only need Redis cache support **, Django 4.2+ now includes native Redis support via
21+ ``django.core.cache.backends.redis.RedisCache ``. For new projects using only Redis, we
22+ recommend using Django's built-in support instead of this library.
23+
24+ **This project remains useful for: **
25+
26+ - Supporting non-Redis cache backends (memcached, file, database, etc.)
27+ - Using URL-based cache configuration for any backend (12-factor app pattern)
28+ - Maintaining legacy projects already using django-cache-url
29+ - Projects that need multiple cache backend support with unified configuration
30+
31+ **For Redis-only new projects **: See `Django's cache documentation <https://docs.djangoproject.com/en/stable/topics/cache/#redis >`_
32+ for native Redis setup.
33+
34+ ----
35+
1736This simple Django utility allows you to utilize the
1837`12factor <http://www.12factor.net/backing-services >`_ inspired
1938``CACHE_URL `` environment variable to configure your Django application.
@@ -39,6 +58,32 @@ Parse an arbitrary Cache URL::
3958
4059 CACHES = {'default': django_cache_url.parse('memcache://...')}
4160
61+ Migrating to Django's Native Redis Support
62+ -------------------------------------------
63+
64+ If you're using this library only for Redis and want to migrate to Django's built-in Redis backend (Django 4.2+),
65+ here's how to transition:
66+
67+ **Before ** (using django-cache-url)::
68+
69+ import django_cache_url
70+ import os
71+
72+ CACHES = {
73+ 'default': django_cache_url.config(default='redis://localhost:6379/1')
74+ }
75+
76+ **After ** (using Django's native Redis backend)::
77+
78+ CACHES = {
79+ 'default': {
80+ 'BACKEND': 'django.core.cache.backends.redis.RedisCache',
81+ 'LOCATION': 'redis://127.0.0.1:6379/1',
82+ }
83+ }
84+
85+ For more details, see the `Django Redis cache documentation <https://docs.djangoproject.com/en/stable/topics/cache/#redis >`_.
86+
4287Supported Caches
4388----------------
4489Support currently exists for:
0 commit comments