﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24035	Poor/incorrect documentation for CACHE_MIDDLEWARE_KEY_PREFIX in relation to CACHES[alias]['KEY_PREFIX']	Frankie Robertson	Frankie Robertson	"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`."	Bug	closed	Documentation	dev	Normal	fixed			Accepted	0	0	0	0	0	0
