Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#17083 closed New feature (fixed)

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

Reported by: charles@… Owned by: Aymeric Augustin
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 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Yes, this is a good suggestion.

comment:2 Changed 4 years ago by Alex Tomkins

Version: 1.3master

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

comment:3 Changed 4 years ago by Claude Paroz

Has patch: set
Needs tests: set

comment:4 Changed 4 years ago by Aymeric Augustin

Patch needs improvement: set

comment:5 Changed 4 years ago by Aymeric Augustin

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 4 years ago by Aymeric Augustin

Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 Changed 4 years ago by Aymeric Augustin

Owner: changed from nobody to Aymeric Augustin

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

Resolution: fixed
Status: newclosed

In 146ed13a111c97c1c04902a6c0eda1e4ee6e604c:

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

comment:9 Changed 4 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