Let's say i have an ajax function in my js code. I am going to use jQuery.
function ajaxcall(a, b) {
$.ajax({
method: "POST",
url: "example.php",
data: {
n: a,
y: b
}
}).done(function(msg) {
alert("Data Saved: " + msg);
});
}
var interval=setInterval(ajaxcall("Dany", 20), 60000);
I'll call this function once per minute and basicly when i change interval time to 500 it will do 120times/minute, thats 120 users.
var interval=setInterval(ajaxcall("Dany", 20), 500);
The thing is that i know how to prevent multiple calls in my php file, but the problem is that the server must respond every time and that means my server is obligated to work and to process something.
In my php file, i have 6 lines of code which will detect every unneeded call. and 6 lines are almost nothing, but the call exists.
My question is: How much these types of calls are going to harm my server s performace? Is it something I should worry about?
sorry for my bad english I hope you understand my question. thanks