Opened 15 months ago

Closed 12 months ago

Last modified 12 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 Changed 15 months ago by Carlton Gibson

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 Changed 15 months ago 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.

comment:3 Changed 12 months ago by Joseph V Zammit

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

comment:4 Changed 12 months ago by Joseph V Zammit

comment:5 Changed 12 months ago by Mariusz Felisiak

Has patch: set

comment:6 Changed 12 months ago by GitHub <noreply@…>

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 Changed 12 months ago by Mariusz Felisiak <felisiak.mariusz@…>

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