How to enable "Keep-Alive" response header for Jetty Web server?
Jetty web server – version 7
Best Answer
Connection: Keep-Alive is only used by HTTP/1.0 clients. The HTTP/1.1 protocol specifies that all connections are persistent by default.
According to the response to this bug (from 2008), since it claims:
Jetty uses persistent connections by default for HTTP/1.1 and if requested by the client for HTTP/1.0.
Jetty should respond with a Connection: Keep-Alive response header if you connect to it with an HTTP/1.0 client that sends a Connection: Keep-Alive request header.
This isn't necessarily a Jetty/Jetty Runner issue. Jetty is the Servlet container, while the response is generated by the servlet (or something higher up which ultimately implements a servlet). Without knowing what you are using above Jetty to generate your content, it is hard to say.
One thing you can do is explicitly define your char-set in the HTML itself using meta tags. HTML5 has simplified how to do this:
Best Answer
Connection: Keep-Alive
is only used by HTTP/1.0 clients. The HTTP/1.1 protocol specifies that all connections are persistent by default.According to the response to this bug (from 2008), since it claims:
Jetty should respond with a
Connection: Keep-Alive
response header if you connect to it with an HTTP/1.0 client that sends aConnection: Keep-Alive
request header.