My ajax request sometimes takes a while to return a response.
$.ajax({
type: 'POST',
url: 'some_url',
data: data,
processData: false,
contentType: false,
headers: {
"Authorization": 'Token token="'+some_token+'"'
}
}).then(function(){
do_something();
});
Typically, if the request takes a few minutes, it works fine. However, if it exceeds around 10 minutes, I encounter the following error:
jquery.js:9175 POST 'some_url' net::ERR_EMPTY_RESPONSE
Even though the server continues to process my request and eventually sends back a Completed 201 Created ...
response once finished, since the error occurs, there seems to be no listener for it at that point.
I would like to inform the user that the process has been completed.
Does anyone have suggestions for the best approach to handle this situation?
Your help would be highly appreciated.