ceylon-herd icon indicating copy to clipboard operation
ceylon-herd copied to clipboard

Persistent connections

Open tombentley opened this issue 8 years ago • 2 comments

I see Herd is sending Connection: close. Why aren't we using persistent connections?

tombentley avatar Mar 10 '16 18:03 tombentley

We do ask for them?

quintesse avatar Mar 10 '16 19:03 quintesse

In HTTP 1.1 you don't have to ask for a connection to be persistent, you have to ask for it to be not persistent (https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.2). Because the server is sending Connection: close it's forcing the client to open a new TCP connection for subsequent resources.

Given the java.net API there's a limited amount you can do to help it reuse connections (https://docs.oracle.com/javase/8/docs/technotes/guides/net/http-keepalive.html), but while the server is sending Connection: close nothing the client does can make a difference, AFAIU.

But maybe there's a good reason... @FroMage?

tombentley avatar Mar 10 '16 21:03 tombentley