D
D
Denis2016-09-16 07:56:10
PHP
Denis, 2016-09-16 07:56:10

How to implement a limit on the number of requests to the API?

Good afternoon. I was interested in one question in terms of creating an API web server. How is the limit on the number of requests (per minute, per hour) from one client to the API most often implemented. In which direction to dig and where can I find information on this issue?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-09-16
@denis6064

Everything is simple here:
Each request is recorded in a database table (preferably in Redis): [IP], [login], [timestamp], [number of requests per hour].
Exceeding the required threshold - blocking access to the API by making an entry in the BAN table: [login / IP], [time to allow access]

S
Sergey, 2016-09-16
Protko @Fesor

google "Rate limit"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question