Opened 6 years ago

Closed 4 years ago

#11299 closed (fixed)

Pluggable cache key algorithm

Reported by: ludo Owned by: nobody
Component: Core (Cache system) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

There are certain situations when you need to preserve path details in the generated cache keys, for example when using a hyerarchical cache that lets you expire whole branches of a site. The current way in which cache keys are built by Django loses all path information as keys are opaques, and furthermore it's impossible for a user to override it, short of monkeypatching utils.cache.get_cache_key() and utils.cache._generate_cache_header_key().

It might be useful to add a config setting where the user can specify a couple of generic functions to use instead of the default ones. It will take little work, and make the cache engine much more extensible for advanced uses.

Change History (2)

comment:1 Changed 6 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 4 years ago by otherjacob

  • Resolution set to fixed
  • Status changed from new to closed
  • Triage Stage changed from Design decision needed to Accepted

This appears to be have been added in #13795.

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