{"action":"created","issue":{"url":"https://api.github.com/repos/philipn/django-block-ip/issues/3","labels_url":"https://api.github.com/repos/philipn/django-block-ip/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/philipn/django-block-ip/issues/3/comments","events_url":"https://api.github.com/repos/philipn/django-block-ip/issues/3/events","html_url":"https://github.com/philipn/django-block-ip/issues/3","id":57472286,"number":3,"title":"Cache the BlockIP queryset in middleware","user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-12T15:11:45Z","updated_at":"2015-02-18T15:44:46Z","closed_at":null,"body":"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.\r\n\r\n([django-banish caches its Banishment queryset during middleware `init`](https://github.com/yourabi/django-banish/blob/master/banish/middleware.py#L28-L68), but it has [a pretty serious bug with `TIMEOUT`](https://github.com/yourabi/django-banish/issues/22)s.)\r\n\r\nSo, 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."},"comment":{"url":"https://api.github.com/repos/philipn/django-block-ip/issues/comments/74886284","html_url":"https://github.com/philipn/django-block-ip/issues/3#issuecomment-74886284","issue_url":"https://api.github.com/repos/philipn/django-block-ip/issues/3","id":74886284,"user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T15:44:46Z","updated_at":"2015-02-18T15:44:46Z","body":"@philipn - how actively are you maintaining this library? Any chance you'll be able to work on these issues?"}}