在哪里可以找到所有浏览器的默认超时设置?

发布于 2024-08-03 07:36:47 字数 96 浏览 6 评论 0 原文

我正在寻找某种文档,指定每个浏览器(IE6/IE7/FF2/FF3 等)在放弃和超时之前等待请求的时间。

我没有运气试图得到这个。

有什么指点吗?

I'm looking for some kind of documentation that specifies how much time each browser (IE6/IE7/FF2/FF3, etc) will wait on a request before it just gives up and times out.

I haven't had any luck trying to get this.

Any pointers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

聆听风音 2024-08-10 07:36:47

我设法找到了旧版本 Mozilla 的 network.http.connect.timeout :

此偏好是多个偏好之一
添加以允许低级调整
HTTP 网络代码。经过一个
同一代码的一部分是
2001 年进行了重大重写,
偏好不再产生任何影响
(正如早在 all.js 中所指出的
2001 年 9 月)。

目前超时已确定
通过系统级连接
建立超时。添加一种方法
配置该值被认为是
低优先级。

看起来 network.http.connect.timeout 已经有一段时间没有执行任何操作了。

我还看到了对 network.http.request.timeout 的引用,因此我执行了 Google 搜索。结果包含许多指向人们的链接,建议其他人将其包含在 about:config 中,这似乎是一种错误的信念,认为它确实做了一些事情,因为相同的搜索会出现此 about:config 条目 文章:

偏好设置已删除(未使用)
上一篇:HTTP 特定网络
暂停。默认值为120

同一页面包含有关 network.http.connect.timeout 的其他信息:

偏好设置已删除(未使用)
以前:确定需要多长时间
等待响应直至注册
超时。默认值为30

免责声明:MozillaZine 知识库上的信息可能不正确、不完整或过时。

I managed to find network.http.connect.timeout for much older versions of Mozilla:

This preference was one of several
added to allow low-level tweaking of
the HTTP networking code. After a
portion of the same code was
significantly rewritten in 2001, the
preference ceased to have any effect
(as noted in all.js as early as
September 2001).

Currently, the timeout is determined
by the system-level connection
establishment timeout. Adding a way to
configure this value is considered
low-priority.

It would seem that network.http.connect.timeout hasn't done anything for some time.

I also saw references to network.http.request.timeout, so I did a Google search. The results include lots of links to people recommending that others include it in about:config in what appears to be a mistaken belief that it actually does something, since the same search turns up this about:config entries article:

Pref removed (unused).
Previously: HTTP-specific network
timeout. Default value is 120.

The same page includes additional information about network.http.connect.timeout:

Pref removed (unused).
Previously: determines how long to
wait for a response until registering
a timeout. Default value is 30.

Disclaimer: The information on the MozillaZine Knowledge Base may be incorrect, incomplete or out-of-date.

爱人如己 2024-08-10 07:36:47

上次 Firefox 更新后,我们遇到了相同的会话超时问题,以下设置有助于解决该问题。

我们可以通过network.http.response.timeout参数来控制它。

  1. 打开 Firefox,在地址栏中输入“about:config”,然后按 Enter。
  2. 点击“我会小心的,我保证!”按钮。
  3. 在搜索框中输入“timeout”,将显示 network.http.response.timeout 参数。
  4. 双击 network.http.response.timeout 参数,然后在框中输入您不希望会话超时的时间值(以秒为单位)。

After the last Firefox update we had the same session timeout issue and the following setting helped to resolve it.

We can control it with network.http.response.timeout parameter.

  1. Open Firefox and type in ‘about:config’ in the address bar and press Enter.
  2. Click on the "I'll be careful, I promise!" button.
  3. Type ‘timeout’ in the search box and network.http.response.timeout parameter will be displayed.
  4. Double-click on the network.http.response.timeout parameter and enter the time value (it is in seconds) that you don't want your session not to timeout, in the box.
画中仙 2024-08-10 07:36:47

首先,我不认为只有一种解决方案可以解决您的问题......

如您所知,每个浏览器都有很大不同。

但让我们看看我们是否可以更接近您需要的答案...

我认为 IE 可能很容易...

检查此链接
http://support.microsoft.com/kb/181050

对于 Firefox,请尝试以下操作:

打开 Firefox,并在地址栏中输入“about:config”(不带引号)。从那里,向下滚动到 Network.http.keep-alive 并确保将其设置为“true”。如果不是,双击它,它就会从 false 变成 true。现在,转到 network.http.keep-alive.timeout 下方的一个 - 并通过双击更改该数字。如果你在那里投入 500 美元,你应该会很好。让我们知道这是否有帮助

firstly I don't think there is just one solution to your problem....

As you know each browser is vastly differant.

But lets see if we can get any closer to the answer you need....

I think IE Might be easy...

Check this link
http://support.microsoft.com/kb/181050

For Firefox try this:

Open Firefox, and in the address bar, type "about:config" (without quotes). From there, scroll down to the Network.http.keep-alive and make sure that is set to "true". If it is not, double click it, and it will go from false to true. Now, go one below that to network.http.keep-alive.timeout -- and change that number by double clicking it. if you put in, say, 500 there, you should be good. let us know if this helps at all

感情废物 2024-08-10 07:36:47

对于 Google Chrome(在版本 62 上测试),

我试图保持从 google chrome 的 fetch API 到远程 Express 服务器的套接字连接处于活动状态,并发现请求标头必须与 Node.JS 的本机 匹配; 连接设置。

我使用以下选项在客户端脚本上设置标头对象:

/* ----- */
head = new headers();
head.append("Connnection", "keep-alive")
head.append("Keep-Alive", `timeout=${1*60*5}`) //in seconds, not milliseconds
/* apply more definitions to the header */
fetch(url, {
    method: 'OPTIONS',
    credentials: "include",
    body: JSON.stringify(data),
    cors: 'cors',
    headers: head, //could be object literal too
    cache: 'default'
 })
 .then(response=>{
    ....
  }).catch(err=>{...});

在我的 Express 服务器上,我按如下方式设置路由器:

 router.head('absolute or regex', (request, response, next)=>{
  req.setTimeout(1000*60*5, ()=>{
     console.info("socket timed out");
   });
  console.info("Proceeding down the middleware chain link...\n\n");
  next();
 });

 /*Keep the socket alive by enabling it on the server, with an optional 
  delay on the last packet sent 
 */
server.on('connection', (socket)=>socket.setKeepAlive(true, 10))

警告

请使用常识并确保您保留的用户打开的套接字连接已验证并序列化。它也适用于 Firefox,但如果您保持 TCP 连接打开时间超过 5 分钟,它就非常容易受到攻击。

我不确定一些不太知名的浏览器是如何运行的,但我也会在这个答案中附加 Microsoft 浏览器的详细信息。

For Google Chrome (Tested on ver. 62)

I was trying to keep a socket connection alive from the google chrome's fetch API to a remote express server and found the request headers have to match Node.JS's native <net.socket> connection settings.

I set the headers object on my client-side script with the following options:

/* ----- */
head = new headers();
head.append("Connnection", "keep-alive")
head.append("Keep-Alive", `timeout=${1*60*5}`) //in seconds, not milliseconds
/* apply more definitions to the header */
fetch(url, {
    method: 'OPTIONS',
    credentials: "include",
    body: JSON.stringify(data),
    cors: 'cors',
    headers: head, //could be object literal too
    cache: 'default'
 })
 .then(response=>{
    ....
  }).catch(err=>{...});

And on my express server I setup my router as follows:

 router.head('absolute or regex', (request, response, next)=>{
  req.setTimeout(1000*60*5, ()=>{
     console.info("socket timed out");
   });
  console.info("Proceeding down the middleware chain link...\n\n");
  next();
 });

 /*Keep the socket alive by enabling it on the server, with an optional 
  delay on the last packet sent 
 */
server.on('connection', (socket)=>socket.setKeepAlive(true, 10))

WARNING

Please use common sense and make sure the users you're keeping the socket connection open to is validated and serialized. It works for Firefox as well, but it's really vulnerable if you keep the TCP connection open for longer than 5 minutes.

I'm not sure how some of the lesser known browsers operate, but I'll append to this answer with the Microsoft browser details as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文