I wonder what server-side will happen when aborting an XHR request in the client,
will the serverside still running, e.g do a transaction in DB?
I wonder what server-side will happen when aborting an XHR request in the client,
will the serverside still running, e.g do a transaction in DB?
Generally in a request, fetch data and return it -scenario the server can only reliably notice that the client has dropped the connection when it will try to write data back to the client (due to how the TCP/IP protocol works).
This can easily cause a scenario where the client makes a request, the server performs expensive work only to find out the client is no longer there and the data is dropped. This is one reason why streaming results are preferable when possible. If you can avoid gathering all the data up front, instead returning them as they become available, you don't risk performing useless work (although the client can still abort mid-connection, but that's his choice).