I have enabled one Rest service with TLS/SSL. While making calls to one of the APIs, for each request new connection is getting created (Persistent Connection is not working), SSL handshake is happening which is creating a huge impact on the latency. I checked the request headers (from client) and found the Connection: Keep-Alive and Keep-Alive: timeout=10, max=20 are present. I also checked the response(from the server) and didn't find the Connection: Close (also tried to set the Connection and Keep-Alive forcefully), which indicates that server is not closing the connection.But still for every request new connection is getting created.
Client Side Description
Jersey Client + Apache Connector
Server Side Description
Embedded Tomcat
Though at the client side, doing Response.close() (or readEntity) is recommended. But I think It closes the connection so how to use the persistent connections as well as Response.close()/readEntity() at the same time?