Jump to content
michelangelo

Rate-Limit Throttling in PW

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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?

  • Thanks 1

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...