Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#17083 closed New feature (fixed)

sessions.backends.cache does not allow non-default cache to be configured

Reported by: charles@… Owned by: aaugustin
Component: contrib.sessions Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django 1.3 introduced support for more than one cache to be defined. However, the cache-based session store backend does not support using a non-default backend.

A configuration option should be available to select the cache to be used by the Django session store cache backend.

Use case: One may want the session store to be kept in a replicated cache (to prevent user-visible disruption during failover events) vs cached data which can be regenerated without user-visible impact beyond performance.

Use case: One may want the session store to be kept in a distributed cache while keeping other content in a system-local cache.

Change History (9)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Yes, this is a good suggestion.

comment:2 Changed 3 years ago by aptomkins

  • Version changed from 1.3 to master

Sent a pull request which should allow a custom cache backend - https://github.com/django/django/pull/169

comment:3 Changed 3 years ago by claudep

  • Has patch set
  • Needs tests set

comment:4 Changed 2 years ago by aaugustin

  • Patch needs improvement set

comment:5 Changed 2 years ago by aaugustin

For consistency with other parts of Django, I'd prefer adding a setting (yeah...) rather than hardcoding a cache name.

Pull request: https://github.com/django/django/pull/479

(I forgot to add a comment in the release notes.)

comment:6 Changed 2 years ago by aaugustin

  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 2 years ago by aaugustin

  • Owner changed from nobody to aaugustin

comment:8 Changed 2 years ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 146ed13a111c97c1c04902a6c0eda1e4ee6e604c:

Fixed #17083 -- Allowed sessions to use non-default cache.

comment:9 Changed 2 years ago by Aymeric Augustin <aymeric.augustin@…>

In 0dcaddb57143048c4647047ccbb5574d2ea713a5:

Fixed #17083 -- Allowed sessions to use non-default cache.

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