I have a problem with an HTML5 web application where I repeat data updates through an ajax request every two seconds. The first two or three go through 175 ms, but after that they slow down to 500 ms, since then. The business company swears that they are not them. I did a simple test - see Test Scripts below. This is not my application, as this test script has the same results. My question is: Is this a hosting management tool, thinking it's a DDoS attack, or is there something I can do to stop this throttling and slow down ajax requests?
Index file:
<!DOCTYPE html> <html> <head> <script src="jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ var count = 0; var my_timer = setInterval(function(){ $.ajax({url: "test.php", success: function(result){ $("#div1").html(result); }}); count = count + 1; if(count == 10) clearInterval(my_timer); },2000); }); }); </script> </head> <body> <div id="div1">Let jQuery AJAX Change This Text</div> <br> <button>Get External Content</button> </body> </html>
Php file:
<?php echo date('h:i:s'); ?>
source share