I performed this test:
On my "raspberry pi" I host a website
Then when I load the website I open the DevTools and put this code:
setInterval(function(){
$.ajax({
success: function(result){
console.log(result);
}
});
},1);
This makes a request to the same page every 1 ms
10 sec after, I get this error "net::ERR_INSUFFICIENT_RESOURCES"
In this case the "raspberry pi" is limited i know, but the same tipe of massive request on webhost should make the server slowdown.
My question is, on a production environment, what is the best practice to avoid this massive request injection?
Is php(in my case) should handle this requests? is Apache? Firewall?
Thanks for your time guys.