I am creating a small web app.
In one of the webpage in the app, part of the page is update using ajax. Ajax will retrieve the data from a java servlet on the server.
I am new to ajax (and javascript) and I don't understand some of the in's and out's of it.
Do I need to use xmlhttprequest.timeout in case the server take too long to send the response? I understand that some browsers don't support this, so is it unrelaible?
Does ajax consume data while waiting for the response from the server? I am asking this in case the server takes too long to send the response and the user is using a mobile device with data allowance limits?
I would appreciate any help on this
Edit: I am using tomcat on the backend server. How can I tell tomcat to send a 408 (server timeout), if the request/response is taking to long to process? I understand that I cannot do this in server.XML as connection timeout is only if the server has not received the request or am I wrong?