Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache the BlockIP queryset in middleware #3

Closed
groovecoder opened this issue Feb 12, 2015 · 1 comment
Closed

Cache the BlockIP queryset in middleware #3

groovecoder opened this issue Feb 12, 2015 · 1 comment

Comments

@groovecoder
Copy link

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 TIMEOUTs.)

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
Copy link
Author

@philipn - how actively are you maintaining this library? Any chance you'll be able to work on these issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant