Limiting volume of outgoing bytes (quota plugin)


is there a plugin to configure a limit (quota) per IPv4 (or per /64 for IPv6) of the total bytes sent by Caddy to that IP ?
I found some usual rate limiting stuff but they’re mostly instant and stateless.

Here we need something that accumulate outgoing bytes per IP and when above a configured threshold value the server redirects or rejects further requests from that IP.
After a configurable cooldown, the IP is unblocked again.

For instance: every IP is allowed to download a total of 10 GB from the server over a sliding period of 24 hours. Any IP downloading more than 10 GB in the last 24 hours will be blocked for 8 hours then allowed to download again (the counter resets completely to 0)


This plugin does rate limiting by number of requests, maybe it could be augmented to limit by number of bytes. idk. /cc @matt

If you need it for your business, you might consider sponsoring development of it:

1 Like

Hmm yeah this sounds pretty involved (and you’re the first request we’ve had for it). Probably best to hire this work. Happy to send an estimate for it, just contact at the link above.