#19221: Check that cache keys are string
-------------------------------------+-------------------------------------
     Reporter:  Mark Hughes          |                    Owner:  Dan
                                     |  Stephenson
         Type:  Bug                  |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Dan Stephenson):

 Can i propose prepending the name of the keys object type, to fix the
 issue of `42` and `"42"` pointing at same data as it does currently.

 {{{
 return '%s:%s:%s_%s' % (key_prefix, version, type(key).__name__, key)
 }}}


 The challenge for this change would be in how we handle pre-existing cache
 keys after Django is upgraded.

 - We could add some code into the **has_key** function temporarily, so
 that in scenarios where it returns None, there is an additional check
 against the legacy format, if something is found, we would update the
 cache key (delete the old one), and return it.

 or

 - Add an advisory to the release notes that the internal cache naming has
 changed, and to prevent orphaned keys taking up space, its recommended to
 flush existing caches alongside the version upgrade.

 comments welcome!

--
Ticket URL: <https://code.djangoproject.com/ticket/19221#comment:15>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.736173d853562ed12d2f9d997ed776a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to