Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#33797 closed Cleanup/optimization (fixed)

Reword session docs on prioritizing "cache" vs "cached_db"

Reported by: Adam Johnson Owned by: Joseph V Zammit
Component: contrib.sessions Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 a forum question from Tim Schilling about migrating between cache servers with the "cache" backend, which is not easy.

Change History (7)

comment:1 by Carlton Gibson, 2 years ago

Triage Stage: UnreviewedAccepted

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.

comment:2 by Adam Johnson, 2 years ago

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

comment:3 by Joseph V Zammit, 2 years ago

Owner: changed from nobody to Joseph V Zammit
Status: newassigned

comment:5 by Mariusz Felisiak, 2 years ago

Has patch: set

comment:6 by GitHub <noreply@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In fa9ac16c:

Fixed #33797 -- Prioritized cached database backend for cached sessions in docs.

Co-authored-by: Adam Johnson <me@…>

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In d959d66f:

[4.1.x] Fixed #33797 -- Prioritized cached database backend for cached sessions in docs.

Co-authored-by: Adam Johnson <me@…>
Backport of fa9ac16c1345a7fb6ad500c84961a954529ba2b9 from main

Note: See TracTickets for help on using tickets.
Back to Top