lemmy
lemmy copied to clipboard
Make an existing rate limit library good like our rate limiter, then use that library here
Make it optimized and properly handle ipv6
Or move our existing rate limit code to a separate crate and make it a new library.
Ideally this should be an actix guard or middleware. I did find this https://github.com/jacob-pro/actix-extensible-rate-limit
That one only seems to support an overall rate limit for all routes, not separate limits per endpoint like we have now. On the other hand it can rollback based on response code which we need for #5548 and returns headers like x-ratelimit-remaining.