Request ajax takes a long time to execute

Asked

Viewed 577 times

0

I have an ajax request in which the method used is the POST, the information I pass is with a formData object, in it has some photos that can vary from 1 until 15, when I run it in localhost does not last 1 second, now that I’ve uploaded the site to the hosting server it takes 120 and stops running, my question is, what might be causing this since the local server runs almost instantaneously?

$.ajax({
    url: '../controller/inserir_prova_banco.php',
    method: 'POST',
    data: formData,
    processData: false,
    contentType: false,
    success: function(data){}
});

1 answer

0

Friend, there are several factors that can cause this.

First, the local server latency is zero. It will run instantly.

Now when it’s web server, somewhere else.... Oh yeah, look what might be trouble to get so slow.

1- Your internet is extremely slow and slow 2- There may be a route problem, from your computer to the server 3- Your web server, may be over loading with many Simultaneos clients.... 4- Its application is poorly structured etc....

There are several factors... but what I believe is, is that your server is slow.... if you do not have POST files... I think it is your server even

  • Do you tell me the structure and configuration of my hosting server? If so, is there anything I can ask them to change? I think it has to do with the files as I have other ajax requests that do not pass files as parameters, only text, and then it works.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.