Code

Opened 3 years ago

Closed 21 months ago

Last modified 21 months 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.

Attachments (0)

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 2 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 2 years ago by claudep

  • Has patch set
  • Needs tests set

comment:4 Changed 21 months ago by aaugustin

  • Patch needs improvement set

comment:5 Changed 21 months 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 21 months ago by aaugustin

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

comment:7 Changed 21 months ago by aaugustin

  • Owner changed from nobody to aaugustin

comment:8 Changed 21 months 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 21 months ago by Aymeric Augustin <aymeric.augustin@…>

In 0dcaddb57143048c4647047ccbb5574d2ea713a5:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.