Cache the BlockIP queryset in middleware
Closed this issue · 1 comments
groovecoder commented
Calling BlockIP.objects.all()
for every process_request
can send "Too Many"™ database queries. And there's an existing TODO
in the code to optimize it.
(django-banish caches its Banishment queryset during middleware init
, but it has a pretty serious bug with TIMEOUT
s.)
So, to correctly cache BlockIP
querysets, django-block-ip should cache the queryset with no timeout, and rely on model signal handlers to update and delete the cache.
groovecoder commented
@philipn - how actively are you maintaining this library? Any chance you'll be able to work on these issues?