If you expect multiple database queries to return, you might consider splitting your web services into multiple AJAX calls. In other words, make 2 AJAX requests, one for the first request and the second for the second request (which gets its value 30 seconds after the first). That way, you can return the first request to the page and display it - or something else that needs to be done - waiting for any additional AJAX calls.
Of course, you can extend this technique to additional AJAX requests as needed.
source share