开发者

Doubt in browser server interaction

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 re开发者_Python百科ply?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜