While building a small experimental HTTP server, I need to implement the persistent connection feature of HTTP 1.1 (and the pipelining feature). How do I test it? Using a browser like Firefox gives me little or no control, and it's hard to check. Any ideas?
Thanks
The best place to start is in the Headers View. The Headers View will identify both the protocol used, as well as other HTTP Headers being sent back. If you see the header: “Connection: close”, then your site is not using persistent connections.
In order to check if your pages are delivered with a Keep-Alive header, you can use the HTTP Header Checker tool. This will display the Connection: Keep-Alive field if the HTTP Keep-Alive header is enabled.
HTTP has a persistent connection function that allows the channel to remain open rather than be closed after a requested exchange of data. TCP is a connection-oriented protocol: It starts a connection after confirmation from both ends that they are available and open to a data exchange.
As a result, all HTTP/2 connections are persistent, and only one connection per origin is required, which offers numerous performance benefits.
In HTTP/1.1, persistence is the default, and the header is no longer needed (but it is often added as a defensive measure against cases requiring a fallback to HTTP/1.0).
The Connection general header controls whether the network connection stays open after the current transaction finishes. If the value sent is keep-alive , the connection is persistent and not closed, allowing for subsequent requests to the same server to be done.
In Firefox, the number of simultaneous connections can be customized (per-server, per-proxy, total). Persistent connections time out after 115 seconds (1.92 minutes) of inactivity which is changeable via the configuration.
curl(http://curl.haxx.se/) -- gives you very good control over GET/POST and many other attributes.
curl also comes with libcurl so that you can do things programatically.
Perl and python(urllib or urllib2 ) will help you get there.
ab, or ApacheBench is a commandline benchmark for HTTP servers. The -k
option makes it use KeepAlive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With