Stopping AJAX request on server side
Posted: Sat Jun 27, 2009 4:00 pm
Hi everyone,
I have an application that relies on PHP for processing some AJAX requests. In some cases the processing time might be quite long and the user could initiate a new request before the server has a chance to respond. Is there a way to interrupt the previous call?
Since apache handles the requests it does not seem to be a trivial task. What I've tried so far:
Thanks/
moliate
I have an application that relies on PHP for processing some AJAX requests. In some cases the processing time might be quite long and the user could initiate a new request before the server has a chance to respond. Is there a way to interrupt the previous call?
Since apache handles the requests it does not seem to be a trivial task. What I've tried so far:
- Calling 'XMLHttpRequest.abort()' - does not seem to send anything to the server. Furthermore the client gladly accepts "aborted" responses.
Spawning my own process using stuff like system() and the process library (a bad idea in a webserver environment...)
Trying to track the PID of the apache spawned process and kill it when a new request is made (no - even worse!!)
Trying to create a "session singleton" that ensures that only one request per session can be made (working on it, but it seems hackish at best)
Thanks/
moliate