github zhangjiayin/caddy-geoip2 v1.3.1

2 hours ago

Fix GeoIP lookups becoming empty after caddy reload (#19, #20).

  • Create separate app and handler instances for each configuration.
  • Open existing local databases during provisioning, before apps start serving.
  • Keep readers available to old HTTP requests while they drain. Final readers are reclaimed after their state becomes unreachable; readers replaced by updates close immediately.
  • Initialize and stop background updates safely, and retain usable readers when a refresh cannot open any databases.
  • Add regression coverage for repeated reloads, in-flight requests, and reader cleanup; use isolated test ports.

Validation: go test -race -count=10 ./... passed. A Caddy v2.11.4 build with a real GeoLite2-City database completed 100 reloads successfully.

Initial missing database downloads remain asynchronous; placeholders use defaults until a database becomes available.

Thanks to @dmitry-simple-it for reporting and fixing the shared-instance issue.

Don't miss a new caddy-geoip2 release

NewReleases is sending notifications on new releases.