[Django] #36836: Add version identification to Redis cache backend

6 views
Skip to first unread message

Django

unread,
Dec 29, 2025, 8:17:34 AM12/29/25
to django-...@googlegroups.com
#36836: Add version identification to Redis cache backend
---------------------------+-----------------------------------------------
Reporter: vchomakov | Type: New feature
Status: new | Component: Core (Cache system)
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+-----------------------------------------------
The Redis documentation recommends that clients identify themselves using
the lib_name and lib_version connection parameters. This helps Redis
operators monitor connections and debug issues in production environments.

See: https://redis.io/docs/latest/commands/client-setinfo/

Django's Redis cache backend should follow this recommendation by
automatically setting these parameters when creating connection pools.

Proposed implementation:
- Set lib_name to 'redis-py(django_v{version})'
- Set lib_version to the redis-py version
- Only set these if not already provided by the user (backward compatible)
--
Ticket URL: <https://code.djangoproject.com/ticket/36836>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 29, 2025, 8:49:51 AM12/29/25
to django-...@googlegroups.com
#36836: Add version identification to Redis cache backend
-------------------------------------+-------------------------------------
Reporter: vchomakov | Owner: (none)
Type: New feature | Status: new
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahmed Asar):

Hi,
I’d like to work on this ticket.
I’ll investigate how the Redis backend creates connections and propose a
patch implementing CLIENT SETINFO with the suggested defaults, unless
already provided by the user.

Please let me know if that sounds good.
--
Ticket URL: <https://code.djangoproject.com/ticket/36836#comment:1>

Django

unread,
Dec 29, 2025, 9:41:23 AM12/29/25
to django-...@googlegroups.com
#36836: Add version identification to Redis cache backend
-------------------------------------+-------------------------------------
Reporter: Vasil Chomakov | Owner: (none)
Type: New feature | Status: new
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Vasil Chomakov):

* has_patch: 0 => 1

Comment:

PR created: https://github.com/django/django/pull/20476

This adds lib_name and lib_version parameters to Redis connections to
identify Django clients, making it easier for Redis operators to monitor
and debug production environments.
--
Ticket URL: <https://code.djangoproject.com/ticket/36836#comment:2>

Django

unread,
Dec 29, 2025, 10:10:58 AM12/29/25
to django-...@googlegroups.com
#36836: Add version identification to Redis cache backend
-------------------------------------+-------------------------------------
Reporter: Vasil Chomakov | Owner: (none)
Type: New feature | Status: closed
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* resolution: => wontfix
* status: new => closed

Comment:

Django only uses the `redis` package for providing a caching backend so it
seems inapropriate to override the `lib_name` and `lib_version` that
`redis-py` already sets by itself.

Per [https://redis.io/docs/latest/commands/client-setinfo/ Redis docs]

> `lib-name` - meant to hold the name of the client library that's in use.

{{{#!python
(Pdb) pp client.client_info()
{...
'lib-name': 'redis-py',
'lib-ver': '7.1.0',
...
}
}}}

Moreover it seems that `redis.Connection(lib_name)` and `lib_info`
[https://github.com/redis/redis-
py/blob/796428825dd33459b63228d274becc1c217589d1/redis/client.py#L294-L297
are deprecated] so we'd want to use `driver_info` instead.

If we were to change change `lib_name` I think it should be along the
lines of `redis-py(django-cache)` as these connections are only meant to
be used for this purpose but just like each new feature
[https://docs.djangoproject.com/en/6.0/internals/contributing/bugs-and-
features/#requesting-features this should be proposed and discussed first
per the documented process].
--
Ticket URL: <https://code.djangoproject.com/ticket/36836#comment:3>

Django

unread,
Jan 7, 2026, 9:21:09 AMJan 7
to django-...@googlegroups.com
#36836: Add version identification to Redis cache backend
-------------------------------------+-------------------------------------
Reporter: Vasil Chomakov | Owner: (none)
Type: New feature | Status: closed
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Vasil Chomakov):

Thanks, Simon, for the input.

Following the new feature proposal process you referenced, I don’t seem to
have permission to add a new idea to the Django New Features project board
here:
https://github.com/orgs/django/projects/24

Since the board doesn’t allow direct submissions, could you please confirm
the correct way to propose this idea?
Should I open a new issue in this tracker as an appropriate place to
continue that process?

Thanks for the guidance.

— Vasil

Replying to [comment:3 Simon Charette]:
> Django only uses the `redis` package for providing a caching backend so
it seems inapropriate to override the `lib_name` and `lib_version` that
`redis-py` already sets by itself.
>
> Per [https://redis.io/docs/latest/commands/client-setinfo/ Redis docs]
>
> > `lib-name` - meant to hold the name of the client library that's in
use.
>
> {{{#!python
> (Pdb) pp client.client_info()
> {...
> 'lib-name': 'redis-py',
> 'lib-ver': '7.1.0',
> ...
> }
> }}}
>
> Moreover it seems that `redis.Connection(lib_name)` and `lib_info`
[https://github.com/redis/redis-
py/blob/796428825dd33459b63228d274becc1c217589d1/redis/client.py#L294-L297
are deprecated] so we'd want to use `driver_info` instead.
>
> If we were to change change `lib_name` I think it should be along the
lines of `redis-py(django-cache)` as these connections are only meant to
be used for this purpose but just like each new feature
[https://docs.djangoproject.com/en/6.0/internals/contributing/bugs-and-
features/#requesting-features this should be proposed and discussed first
per the documented process].
--
Ticket URL: <https://code.djangoproject.com/ticket/36836#comment:4>
Reply all
Reply to author
Forward
0 new messages