views:

57

answers:

0

When a user takes a particular action on a page, an Ajax call is made to save their data. Unfortunately, this call is synchronous as they need to wait to see if the data is valid before being allowed to continue. Obviously, this eliminates a lot of the benefit of using Asynchronous JavaScript And XML, but that's a subject for another post. That's the design I'm working with.

The request is made using the dojo.xhrPost function, with a 60 sec timeout parameter, and the error handler redirects to an error page. What I am finding in testing is that in Firefox, if I initiate the Ajax request and then press ESC, the page hangs waiting for a response, and then eventually after exactly 90 sec (not 60 sec, the function's timeout), the error handler will kick in and redirect to the error page.

I expected this to happen, but either immediately as soon as the request was cancelled, or after 60 sec due to the timeout value being 60 sec. What I don't understand is why is it 90 sec? What is actually happening under the hood when the user cancels their request in Firefox, and how does it differ from Internet Explorer, where everything works fine exactly the same as if the request had not been cancelled? Is the 90 sec related to any user-configurable browser settings?