dnsbl icon indicating copy to clipboard operation
dnsbl copied to clipboard

Caching

Open niftylettuce opened this issue 6 years ago • 4 comments

It would be great to have caching added somehow to reduce HTTP requests when bots spam servers.

niftylettuce avatar Dec 05 '19 23:12 niftylettuce

DNS is cachable with a caching resolver, such as Unbound.

Install unbound on your server (available in most distros incl. Debian, Fedora, Arch, Ubuntu, etc.), enable&start the service and set ['127.0.0.1'] as the DNS server in options.

theel0ja avatar Dec 10 '19 18:12 theel0ja

Besides putting a caching resolver in front, you could use a in-memory cache and expire it after a fixed amount of time:

https://github.com/medikoo/memoizee#expire-cache-after-given-period-of-time

I'm not totally opposed to having a ttl-based cache in the module, but it would have to be opt-in.

silverwind avatar Dec 10 '19 21:12 silverwind

Could we re-open this for TTL-based cache in module?

niftylettuce avatar Aug 29 '20 21:08 niftylettuce

Or perhaps just add to the README a link to https://github.com/medikoo/memoizee#expire-cache-after-given-period-of-time?

niftylettuce avatar Aug 29 '20 21:08 niftylettuce