Question about hits limit

If I use AJAX to automatically update the database, it will count as a hit? I coded like this…

  function getUserStatus() {
      url: 'ajax/get_user_data.php',
      success: function(result) {
  setInterval(function() {
  }, 1000);

It calls ajax/get_user_data.php pages in every 1 min. it will count as a hit? Please help me as soon as possible. Thank you.

Depending on what is inside get_user_data.php, the number of hits could be much higher than that


Every time a URL is called, it creates a hit. So yes, that code will create one hit a minute, if not more (It would cause more if the get_user_data.php calls other files when it is run.


get_user_data.php, page contains only mysqli queries

Then it will use 1 hit every time it is loaded


Then hits limits are very bad…

What do you mean by that? The number of people that hit this limit is pretty low, as this limit is really high, especially for free.

If you need this limit to be higher, please upgrade to premium hosting. Using AJAX is not really a good idea here for that very reason anyways.


It will be every 1 second since OP set the interval to be every 1000 milliseconds

The limits are not bad. 50,000 hits for a free service is awesome. However, if you still need more, I suggest to


Correction: every second, not every minute.

The second parameter of setInterval takes a time interval in milliseconds. You set it to 1000 milliseconds, which is one second.

If you only want it to trigger once per minute, you need to set it to 60000 instead.

Our hits limit is very reasonable. But if you write code that’s continuously hammering the server in the background because of a coding error, then you’ll exhaust your account’s limits very quickly.

To be very clear: the “call other files” part only applies if you use something like file_get_contents to trigger other URLs on your site. Calling other code by using things like require and include doesn’t generate additional hits usage.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.