#24035: Poor/incorrect documentation for CACHE_MIDDLEWARE_KEY_PREFIX in 
relation to
CACHES[alias]['KEY_PREFIX']
-------------------------------+----------------------
     Reporter:  frankier       |      Owner:  frankier
         Type:  Bug            |     Status:  new
    Component:  Documentation  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+----------------------
 The interaction between CACHES[alias]['KEY_PREFIX'],
 CACHE_MIDDLEWARE_KEY_PREFIX and @cache_page(... key_prefix) is poorly
 documented. It should be made explicit that KEY_PREFIX is always used and
 combined with CACHE_MIDDLEWARE_KEY_PREFIX or @cache_page(... key_prefix)

 Changes should be made to both ref/settings and topics/cache.

 The paragraph at the bottom of
 https://docs.djangoproject.com/en/dev/topics/cache/#the-per-view-cache is
 particularly troublesome:

 "The two settings can also be combined. If you specify a cache and a
 key_prefix, you will get all the settings of the requested cache alias,
 but with the key_prefix overridden.

 Having looked through the source it appears as though the setting
 CACHE_MIDDLEWARE_KEY_PREFIX OR the argument to @cache_page is combined
 with the rest of the cache key using django.utils.cache.get_cache_key
 which is then combined with the CACHES[alias]['KEY_PREFIX'] using
 key_func.

--
Ticket URL: <https://code.djangoproject.com/ticket/24035>
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/051.10309e65d0123e75eb3738b8a09823dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to