I’m currently reloading (refreshing if you prefer that word more) my pages every 5 minutes but this is quite a long time for me. I don’t know how much a reload of a page with the code below affects the server and it’s just that I want to know; if I change the interval time from 5 minutes to 1 second, how much does this take on the server? Will it slow the server down? My website has over 5 visitors per half hour but it will be more after the update.
$(document).ready(function() {
setInterval(function() {
$('#loading-page').show().html('<img src="images/animation-loading.gif" alt="" title="Reloading the page">');
$.ajax({
url: 'get/statistics',
type: 'GET',
success: function(s) {
$("#load-statistics").html(s);
},
error: function() {
$('#loading-page').show().html('<img src="images/exclamation-red.png" alt="" title="Couldn't reload page. Trying again soon">');
}
});
}, 300e3);
});
Thanks in advance.
You can test it yourself. Try this:
Check the console for the processing time. You can then change the interval time based on the average of lets say 10-20 sample time you will get at the console.