Search code examples
asp.netajaxwindows-server-2012iis-8

Is it possible to cancel AJAX request sent to a Windows server 2012 / IIS8


If you make, say, 10 ajax requests to server, and they are queued up in the server and are being processed one by one, it is possible to somehow tell the server (from the front end UI) to not process some of them?


Solution

  • In short there is no simple or pre-existing way to do this that I am aware of. If you can clarify your question we may be able to help some more. Some background ...

    1) Request queuing is the responsibility of most web server applications, allowing one request to interfere with another would break isolation and security concerns. If this functionality was generally available it could be used as a vector for DDOS attacks.

    2) AJAX requests are generally quick calls to obtain data or execute some change in state. Long running calls could block the request queue and prevent any web server application from scaling if there were enough of them (we are probably talking 1000s).

    3) Most web servers process requests in parallel. With this in mind the situation you describe is unlikely to happen. Additionally there is no guarantee that the requests from your Front End UI would arrive in order they are sent.