Netty ChannelUpstreamHandler 和 HTTP 管道
我正在玩 Netty 示例 org.jboss.netty.example.http.snoop ,我注意到 Firefox 执行 4 个请求,导致创建 4 个 HttpRequestHandler
实例,而 Internet Explorer 8/9 执行 2 个请求,导致创建 2 个 HttpRequestHandler
实例。
我认为这是由于 HTTP 1.1 管道造成的,但是即使在更改 FireFox 的 network.http.pipelined.*
键和 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings 后
IE 的注册表项,Netty 的行为方式相同。
我的问题是,这是预期的且正确的,还是我遗漏了一些东西,是否可以配置 Netty 来删除后续的幂等请求,或者这最终必须由 HttpRequestHandler 实现?
I was playing with the Netty example org.jboss.netty.example.http.snoop
and I noticed that
Firefox does 4 requests leading to the creation of 4 HttpRequestHandler
instances and Internet Explorer 8/9 does 2 request leading to the creation of 2 HttpRequestHandler
instances.
I think this is due to the HTTP 1.1 pipelining, however even after changing the network.http.pipelining.*
keys for FireFox and the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
registry entries for IE, Netty behaves the same way.
My question is, is this expected and correct or am I missing something and is it possible to configure Netty to drop subsequent idempotent requests or this has to be implemented by the HttpRequestHandler
eventually?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该打印出路径来找出 FF 所请求的内容。我很确定它是 favicon.ico,它被多次请求(重试机制),因为 Snoop 示例发送的格式无效。
编辑。我验证了一下,确实是请求了3次的favicon:
You should print out the path to find out what FF is requesting. I am pretty sure it is favicon.ico which is requested multiple times (retry mechanism) because of invalid format being sent by Snoop example.
edit. I verified it, and it is indeed favicon which is requested three times: