Simple example: lets say that i have an api endpoint that makes many queries to my database. i want
Simple example: lets say that i have an api endpoint that makes many queries to my database. i want to limit the endpoint usage by ip to like 10 hits in 10 seconds. I want to limit this to minimize the reads/writes my database does. Would i be able to create a middleware in front of the endpoint that checks the remaining queries for the specific ip? I understand that my worker would still be invoked, but could this be used to prevent querying my database in such cases?






