当我们刷新一个网页,会发生什么? [英] What happens when we refresh a web page?

查看:453
本文介绍了当我们刷新一个网页,会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望如果有人能回答这个问题我有一个关于网页的清爽一个根本性的问题。

I was hoping if anyone can answer a fundamental question that I have regarding refreshing of a web page.

我有其中一个用户填写的一些细节,并点击提交DOTNET网络表单。网页背后的code具有约20函数来执行。

I have a dotnet webform where a user fills in some details and clicks submit. The code behind of the webpage has about 20 functions to perform.

现在假设,当用户点击提交按钮的网页被执行第五函数,同时用户刷新他的浏览器;

Now assuming, when the user clicks the submit button the web page is executing the 5th function and meanwhile the user refreshes his browser;

会发生什么已经在处理网页?
将在页面立即终止?
还是会被允许运行,直到它执行20功能?
或将在页面运行被破坏和新的页面创建并发送到客户端?

What will happen to the already processing page? Will the page be terminated immediately? or will it be allowed to run till it executes the 20th function? or will the page running be destroyed and a new page created and sent to client?

谢谢您的回答。

推荐答案

时,从页面被处理,浏览器与服务器建立的。即使用户取消或停止请求时,服务器继续处理该请求。如果用户重新加载/刷新页面,它是将平行于第一个请求执行另一个请求。

Once a request is made to the server from the browser the page is processed. Even if the user cancels or stops the request, the server continues to process the request. If the user reloads/refreshes the page, it's another request that will be executed in parallel with the first request.

即使在PHP的情况下,服务器不积极地检查所述用户已经中止的连接。服务器只知道,当它试图返回请求的结果,它已经中止。

Even in the case of PHP, the server isn't actively checking if the user has aborted the connection. The server only knows it's been aborted when it attempts to return the results of the request.

互联网是一个断开连接的环境。服务器不知道浏览器的任何事情。服务器知道的仅仅是一个请求已经提出,它必须填写的要求。

The internet is a disconnected environment. The server doesn't know anything about the browser. The only thing the server knows is a request has been made and it must fill the request.

这篇关于当我们刷新一个网页,会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆