#32747: CacheHandler initialize unused caches.
-------------------------------------+------------------------------------
Reporter: Alexander Ebral | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 3.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):
* cc: Florian Apolloner (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. I agree this can cause a performance regression, we
shouldn't initialize unused caches unnecessarily. As far as I'm aware we
can restore the previous behavior with:
{{{
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py
index 05ef3897d0..c008ed1125 100644
--- a/django/core/cache/__init__.py
+++ b/django/core/cache/__init__.py
@@ -43,6 +43,8 @@ class CacheHandler(BaseConnectionHandler):
) from e
return backend_cls(location, params)
+ def all(self):
+ return [self[alias] for alias in self if
hasattr(self._connections, alias)]
caches = CacheHandler()
}}}
Regression in 98e05ccde440cc9b768952cc10bc8285f4924e1f.
--
Ticket URL: <https://code.djangoproject.com/ticket/32747#comment:1>
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/067.53823ad781b29ebd9b421e814871f9be%40djangoproject.com.