简体   繁体   English

停止异步XMLHttpRequest

[英]stopping asynchronous XMLHttpRequest

I have impatient users who update a piece of data on a web page. 我有些急躁的用户会更新网页上的数据。 The update triggers an asynchronous XMLHttpRequest and the response causes the page to update. 此更新触发异步XMLHttpRequest ,并且响应导致页面更新。

My question is this. 我的问题是这个。 If the user closes the browser window before the request completes, will the browser send an instruction to the web server to stop the request? 如果用户在请求完成之前关闭浏览器窗口,浏览器是否会向Web服务器发送指令以停止请求?

FWIW the users are using Firefox or Safari. FWIW用户正在使用Firefox或Safari。

The browser should close the connection, which should result in the server getting a close/fin packet. 浏览器应关闭连接,这将导致服务器获得关闭/结束数据包。 At that point it is up to the server to decide whether it finishes processing or if it stops processing at that point. 在那时,由服务器决定它是否完成处理或在那一点上停止处理。

I checked to see if I could find what Apache does, but didn't find any documentation on it. 我检查了一下是否可以找到Apache可以做什么,但是没有找到关于它的任何文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM