I have replaced the iframes on my website with AJAX. It's a lot better now and a lot faster. People can click the refresh button to refresh the dynamic areas.
I am using this function for that:
function djrefresh() {
$('#dj_status').load('inc/dj_status_frame.php');
$('#djbanner').load('inc/djbanner.php');
$('#djknopjes').load('inc/dj_knopjes_frame.php');
$('#djzegt').load('inc/dj_zegt_frame.php');
$('#djfooter').load('inc/footer_frame.php');
$('#berichtenbalkframe').load('inc/berichtenbalk_frame.php');
}
Works perfectly fine, but my site needs to load a lot of stuff all at once. I want the user to be able to click it once and get a timeout for 30 seconds.
... or if you have a better idea please tell me. I don't want the user to DDOS my website with my own scripts. Thanks in advance.
setInterval(djrefresh, 30000)for(var i = 0; i < 10000; i++)$('#dj_status').load('inc/dj_status_frame.php');. This could be run from the console of your webpage. It is very important that you are addressing these concerns server side and not client side, as the client cannot be trusted, not even their calls. Further, a DDoS is usually done from a large multitude of IP's that just spam requests; they don't tend to interact with pages at all if it cannot be easily automated.