In a web application that interacts with one server, there is a jQuery Ajax call with a PHP script that takes about 20 seconds to execute.
$(document).ready(function() {
$.ajax({
type: 'POST',
dataType: 'json',
url: 'createPDF.php',
data: str,
success: function(response) {
showPDF(response);
}
error: function() {
console.log('ERROR WHEN CREATING PDF');
}
});
});
In the meantime a user ask to the application to get a list (getList.php) through another jQuery Ajax independant from createPdf.
$(document).ready(function() {
$.ajax({
type: 'POST',
dataType: 'json',
url: 'getList.php',
data: str,
success: function(response) {
showList(response);
}
error: function() {
console.log('ERROR WHEN GETTING LIST');
}
});
});
The problem is that getList.php only starts executing once createPDF.php finishes.
The application works with sessions, and tests have been done in separate clients, in which case both requests run parallel, but in the same computer they don't.
In this scenario how to run both requests parallel?
Thank you