#19221: Cache keys can't be integers
-------------------------------------+-------------------------------------
Reporter: Mark Hughes | Owner: Abhimanyu
| Singh Negi
Type: Bug | Status: closed
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mike Edmunds):
From [https://github.com/django/django/pull/20641#issuecomment-3905712951
discussion on GitHub], if this is still a problem we could try to address
it in the cache docs:
* Note that the default key function has the (potentially surprising)
behavior of treating `42` and `"42"` as equivalent cache keys.
* Suggest using a custom KEY_FUNCTION if that default behavior causes
problems, and show Dan Stephenson's approach from comment:15 (that
includes the key type) as an example.
(If there's interest in that change, it might be easiest to handle it as a
new Documentation ticket that references this one.)
--
Ticket URL: <https://code.djangoproject.com/ticket/19221#comment:28>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019c71b10ca6-87981f3a-90d8-43de-b002-f20f1136def1-000000%40eu-central-1.amazonses.com.