所有主要浏览器允许的最大 HTTP 重定向次数是多少? [英] What is the maximum number of HTTP redirections allowed by all major browsers?

查看:46
本文介绍了所有主要浏览器允许的最大 HTTP 重定向次数是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个分布在许多服务器上的网站,有些页面我需要最多连续链接 4 个重定向.我尝试了几个浏览器(firefox、chrome、IE),它似乎工作正常.

I am designing a web site, spread across many servers, and there are pages where I need up to chain up to 4 redirections in a row. I tried a few browsers (firefox, chrome, IE) and it seems to work fine.

显然,Firefox 的默认限制是连续 20 次重定向,Chrome 的默认似乎是 20,而 IE8 的限制似乎是 10 次重定向.

Apparently, Firefox's default limit is 20 redirections in a row, Chrome's default seems to be 20, and IE8's limit seems to be 10 redirections.

所有主要浏览器允许的最大 HTTP 重定向次数是多少?是 10 点吗?

What is the maximum number of HTTP redirections allowed by all major browsers? Is it 10?

编辑:

为什么我需要 4 次重定向?基本上,用户处于热点中,她尝试访问(例如)google.com,有一个本地强制门户可以捕获请求并将用户重定向(#1)到本地服务器.本地服务器会检查一些关于用户的信息,但如果它在本地没有数据,它会将用户重定向(#2)到中央网站.如果用户已经登录到这个中央网站,她会被重定向(#3)到另一个服务器(根据用户有不同的门户).最后,服务器检查用户的权限,如果她有适当的权限,最后(#4)重定向到本地访问控制器,以便访问适当的服务.相信我,我已尽力删除重定向,但我看不到可以优化的地方.

Why do I need 4 redirections? Basically, the user is in a hotspot, she tries to go to (say) google.com, there is a local captive portal that captures the request and redirects (#1) the user to a local server. The local server checks some things about the user, but if it does not have the data locally, it redirects (#2) the user to the central web site. If the user is already logged in to this central Web site, she gets redirected (#3) to another server (there are different portals depending on the user). Finally, the server checks the user's rights, and if she has the appropriate rights, there is a final (#4) redirection to the local access controller, in order to get access to the appropriate service. Believe me, I tried my best to remove redirections, but I cannot see where this can be optimized.

推荐答案

4 重定向应该适用于所有主要浏览器.但是,请考虑减少数量,以便为用户提供更快的体验.每次重定向都需要用户和服务器之间的往返(如果重定向到不同的服务器,则需要创建新连接).总的来说,延迟会很长,可能会打扰您的用户.

4 redirections should work in all major browsers. However, consider reducing the number to give users a faster experience. Each redirection requires a round trip between the user and the server (and requires creating a new connection, if it's redirecting to a different server). In total, the latency will be significant, likely annoying your users.

这篇关于所有主要浏览器允许的最大 HTTP 重定向次数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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