[英]Keep-Alive Dropwizard
I understand Jetty can be configured via the config file within Dropwizard, however I cannot find a way to enable Keep-Alive, any suggestions on how to implement this rather than a custom filter? 我了解可以通过Dropwizard中的配置文件配置Jetty,但是我找不到启用Keep-Alive的方法,关于如何实现此功能的任何建议,而不是自定义过滤器?
server:
type: simple
applicationContextPath: /
adminContextPath: /admin
connector:
type: http
port: 8080
gzip:
bufferSize: 8KiB
HTTP keep-alive support is available by default in Jetty when using HTTP/1.0 使用HTTP / 1.0时,默认情况下在Jetty中提供HTTP保持活动支持
The use of HTTP/1.0 keep-alive
is dependent on the HTTP Client (its chosen HTTP version support level, and the headers it sends). HTTP / 1.0 keep-alive
的使用取决于HTTP客户端(它选择的HTTP版本支持级别以及它发送的标头)。
Note that keep-alive
is an invalid term/concept/setting/header when using HTTP/1.1 (it has no meaning on HTTP/1.1). 请注意,当使用HTTP / 1.1时, keep-alive
是无效的术语/概念/设置/标题(在HTTP / 1.1上没有意义)。
HTTP/1.1 is connection persistent by default, and you would need to pass a Connection: close
header to request that the connection is closed after the current HTTP exchange. 默认情况下,HTTP / 1.1是持久连接,您需要传递一个Connection: close
标头,以请求在当前HTTP交换之后关闭连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.