michelangelo Posted February 27, 2021 Share Posted February 27, 2021 Hello everybody, I am currently indulging myself into building a REST API based on a older project of mine. It's very simple where you can mainly retrieve information in JSON. It's similar to JSON Placeholder in the level of complexity. I am using the RestAPI Module and native ProcessWire API functions. Rate-Limit Throttling is something I want to implement because it's public without authentication, despite not extremely necessary. Now, is it better to utilise something like Token Bucket or ProcessWire already has some protection against too many requests? There is a simple Token Bucket library I found that is going to work but I want to limit the traffic only to the /api/ route, not to my whole website. All input is appreciated, later I will share the project here. Thanks! Link to comment Share on other sites More sharing options...
horst Posted March 1, 2021 Share Posted March 1, 2021 The only thing what I remember is a login throttle module. Maybe you can copy this and adapt it for your use case, or borough some pieces of code from there? 1 Link to comment Share on other sites More sharing options...
michelangelo Posted March 1, 2021 Author Share Posted March 1, 2021 @horst so I guess this will work If I hook that method every time I access www.website.com/api/ route? And then monitor how many requests I get. I just have to figure how to do those. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now