rack-attack
rack-attack copied to clipboard
Allow customization of weight per request for rate limiting
Use case: We have an API to allow the client to fetch data by a list of ids. The API allows up to a few thousand ids. In order to better throttling experience, we want to throttle based on the number of ids being fetch. Add a weight option to specify the rate to deduct the limit.
Added tests and tests pass.
Hi @jiang925 ,
Thank you very much for the contribution!
On the one hand this seems like an interesting feature, while on the other I have concerns about whether this may add unnecessary complexity to the library and the docs/API if this is not used a lot by users.
I want to give it some more thought though. :thinking:
Thanks again!