Opened 22 months ago

Closed 19 months ago

Last modified 19 months 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, 22 months 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, 22 months 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, 19 months ago

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

comment:5 by Mariusz Felisiak, 19 months ago

Has patch: set

comment:6 by GitHub <noreply@…>, 19 months 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@…>, 19 months 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