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.
* owner: nobody => Iuri de Silvio
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32841#comment:1>
* has_patch: 0 => 1
Comment:
I created a patch. Did some comments to it because I'm not totally happy
with the result, but it works.
--
Ticket URL: <https://code.djangoproject.com/ticket/32841#comment:2>
* status: assigned => closed
* resolution: => invalid
Comment:
Hi.
`CACHE_MIDDLEWARE_KEY_PREFIX` is for
[https://docs.djangoproject.com/en/3.2/topics/cache/#the-per-site-cache
per-site caching] not for `cache_page`, which allows you to set an
additional prefix but is not intended to use the site-level settings.
--
Ticket URL: <https://code.djangoproject.com/ticket/32841#comment:3>
Comment (by Iuri de Silvio):
I misread the docs, expected it to work with `cache_page`. Unfortunately,
Django don't have an easy way for cleaning only `cache_page` cache, I'll
make a cache page wrapper on my side. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/32841#comment:4>
Comment (by Carlton Gibson):
No problem. See #5815 for a suggestion to add easier invalidation here.
It's just looking for a hero to pick it up. 😉
--
Ticket URL: <https://code.djangoproject.com/ticket/32841#comment:5>