Home > Net >  Detect calling multi requests at same time to server
Detect calling multi requests at same time to server

Time:07-13

everyone, I have a problem about HTTP requests: I want to detect calling multi requests (to same url) at same time to prevent from calling it. For example, I have a bug code - a infinite loop (client-side). This code is calling so many requests at same time to server. I want to prevent that or balance it. I don't know that someone has resolved this problem yet. Someone can give me some ideas or algorithms for this problem.

Thanks a lot!

CodePudding user response:

If you want to avoid calling too many times the request from the client side, you can use a lodash.throttle or lodash.debounce. If you want to protect the server from too many requests you can use a pattern called rate limiting. However, in this case, you should probably fix the infinite loop instead

  • Related