[Django] #33797: Reword session docs on prioritizing "cache" vs "cached_db"

17 views
Skip to first unread message

Django

unread,
Jun 21, 2022, 6:07:42 PM6/21/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
------------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.sessions | 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 "using cached sessions" section of the sessions docs
(https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-
sessions) lists "cache" first and doesn't really emphasize the downside of
its non-persistent sessions. I think "cached_db" should be recommended
first, and "cache" listed only as an option when you have a persistent
database server.

Users getting logged out "randomly" due to a full/ephemeral cache server
is not a good user experience. It also leads to operational complexity.
The example that made me check this was [https://forum.djangoproject.com/t
/changing-session-engine-from-cache-to-cached-db/14421 a forum question
from Tim Schilling] about migrating between cache servers with the "cache"
backend, which is not easy.

--
Ticket URL: <https://code.djangoproject.com/ticket/33797>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 22, 2022, 4:11:50 AM6/22/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
--------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

OK, thanks Adam, happy to look at a re-phrasing.

I think there's some value in mentioning that Redis **is persistent**
under standard configurations, so as not to mislead, whilst we're here.

--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:1>

Django

unread,
Jun 22, 2022, 5:06:04 AM6/22/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
--------------------------------------+------------------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Adam Johnson):

Agreed, although it depends on configuration. We could at least mention
"only some cache servers and configurations are persistent", or something
like that.

--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:2>

Django

unread,
Sep 24, 2022, 5:24:31 AM9/24/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Joseph
Type: | Victor Zammit
Cleanup/optimization | Status: assigned

Component: contrib.sessions | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Joseph Victor Zammit):

* owner: nobody => Joseph Victor Zammit
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:3>

Django

unread,
Sep 25, 2022, 7:01:32 AM9/25/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Joseph
Type: | Victor Zammit
Cleanup/optimization | Status: assigned
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Joseph Victor Zammit):

PR is open here: https://github.com/django/django/pull/16095

--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:4>

Django

unread,
Oct 5, 2022, 7:05:45 AM10/5/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Joseph V
Type: | Zammit

Cleanup/optimization | Status: assigned
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:5>

Django

unread,
Oct 7, 2022, 3:40:17 AM10/7/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: closed
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fa9ac16c1345a7fb6ad500c84961a954529ba2b9" fa9ac16c]:
{{{
#!CommitTicketReference repository=""
revision="fa9ac16c1345a7fb6ad500c84961a954529ba2b9"
Fixed #33797 -- Prioritized cached database backend for cached sessions in
docs.

Co-authored-by: Adam Johnson <m...@adamj.eu>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:6>

Django

unread,
Oct 7, 2022, 3:40:52 AM10/7/22
to django-...@googlegroups.com
#33797: Reword session docs on prioritizing "cache" vs "cached_db"
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: closed
Component: contrib.sessions | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d959d66fa9b930c7264cb7db90e8ec626e2c44dd" d959d66f]:
{{{
#!CommitTicketReference repository=""
revision="d959d66fa9b930c7264cb7db90e8ec626e2c44dd"
[4.1.x] Fixed #33797 -- Prioritized cached database backend for cached
sessions in docs.

Co-authored-by: Adam Johnson <m...@adamj.eu>
Backport of fa9ac16c1345a7fb6ad500c84961a954529ba2b9 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33797#comment:7>

Reply all
Reply to author
Forward
0 new messages