﻿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
37290	Update UpdateCacheMiddleware to mark a response as cached	Tim Schilling	Django Sprints	"When caching a response, `UpdateCacheMiddleware` could mark the response such that other logic can determine if the response was already cached. This would allow us to emit warnings that responses are cached unexpectedly. The point here is to help Django apps know when using `@cache_page` that it's caching the response before other middlewares or decorators are able to weigh in. This is related to #15855

The `decorator_from_middleware` that `@cache_page` uses, and the challenges of it was discussed here: https://groups.google.com/g/django-developers/c/-W6YIlT75cM

The following should be updated to check if a response has been cached to emit a warning.

- `@csrf_protect`
- `@patch_vary_headers`
- `@vary_on_headers` (vary_on_cookie)
- `ContentSecurityPolicyMiddleware.process_response`
- `HttpResponseBase.set_cookie` (maybe? this is due to `SessionMiddleware.process_response`)

I think the warning messages may need to be tailored for the particular cases."	New feature	assigned	Core (Cache system)	dev	Normal		headers, caching, cache_page		Accepted	0	0	0	0	0	0
