#32841: Decorator cache_page don't use CACHE_MIDDLEWARE_KEY_PREFIX properly
-----------------------------------------------+------------------------
Reporter: Iuri de Silvio | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
The `cache_page` decorator don't use the setting because it always pass
`key_prefix=None` and `CacheMiddleware` consider it a valid config, so it
overrides the default one.
https://github.com/django/django/blob/854e9b066850b9b4eb1171966e996322b2c16d27/django/views/decorators/cache.py#L24
https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/middleware/cache.py#L175
I discovered the issue because I was moving from Django 3.1 to Django 3.2
and a 3.1 `HttpResponse` is not compatible with 3.2 `HttpResponse` (which
I think is ok, maybe could be better documented), so I have to clean the
cache changing my key prefix with the `CACHE_MIDDLEWARE_KEY_PREFIX`.
--
Ticket URL: <https://code.djangoproject.com/ticket/32841>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/053.0134bd90986452257af27afb8ea89933%40djangoproject.com.