views:

23

answers:

1

Suppose I click on a link to website A on a page and just before the current page gets replaced, I click on a different link to a different website say B.

What happens to the request that was sent to website A? Does the webserver of site A reply back and the browser just rejects the HTTP reply?

+2  A: 

There is no specific HTTP provision for canceling a request. I would expect this to happen at the socket level.

I would expect the associated TCP socket to be closed immediately upon canceling the request. Since http uses only 1 socket, the server will get the close after the request. If the close was processed before the data is generated, generated data down won't be sent to the client. Otherwise the data is sent to the client and ignored since the socket is closed. There may be wasted work, but a special http message to "cancel" would have the same effect.

Doug T.