#5815: Adds per-view cache refreshing (clearing)
-------------------------------------+-------------------------------------
Reporter: k0001 | Owner: Ahter
| Sönmez
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: dev
Severity: Normal | Resolution:
Keywords: cache refresh clear | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahter Sönmez):
Here's a quick update on this:
I think this can be done. However, there are a few things to take into
consideration.
- Django's core caching code is quite old, 18+ years. I believe big part
of it should be redesigned and refactored so it's easy to work on it and
extend it in non-hacky ways. While this refactor is out of scope for this
PR, I think it might be beneficial. I think this might be why this ticket
is quite old.
- Even when we solve this problem, due to the way cache keys are
generated, this will be only supported by some cache backends (ie. Redis)
which allow filtering by keys or part of keys.
- There are better design patterns that would allow more intelligent
caching in the projects/apps that use Django. Especially projects that use
layered architecture. However, this is not applicable to Django as a
library as it cannot be opinionated about how devs would like to structure
their code in their apps.
I finally now have a chance to have a look at this again in DjangoCon
Europe 2023 sprints. This time we've also paired with Marco Silva and
we're tackling the issues together. I'm hoping to work on this more (given
we're now two) and get something out as a PR soon.
--
Ticket URL: <https://code.djangoproject.com/ticket/5815#comment:16>
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/010701887bb184f7-e8965487-c972-4648-80c4-91560f7905dd-000000%40eu-central-1.amazonses.com.