PascalMinder / geoblock

Traefik middleware plugin - Deny requests based on country of origin
98 stars 10 forks source link

How does forceMonthlyUpdate work ? #28

Closed lumpidu closed 1 year ago

lumpidu commented 1 year ago

Let's assume I have set cacheSize: 15000 and forceMonthlyUpdate=true.

Is the monthly update done exactly 1 month after an IP address has been cached or at a fixed interval, e.g. 01.12.2022 ? In the latter case, accessing GeoJs.io with 15000 entries at once would be like a DoS, right ?

PascalMinder commented 1 year ago

If you set the monthly update to true and an IP cache entry is used again, and the entry is older than one month, the entry is invalidated and GeoJs.io will be called.

lumpidu commented 1 year ago

Ok, that sounds reasonable. Is there some minimal time between the requests for these updates ?

PascalMinder commented 1 year ago

No, since the check will be run on each connection. So, if 10 different IP addresses connect and each of them is in the cache and each of them did not visit since 1 months, each 10 will update around the same time.

lumpidu commented 1 year ago

thanks for the clarifications