HTTP persistence just means that you CAN have multiple transactions per TCP connection - so it’s really HTTP keep-alive. And like you say that is what HTTP/1.1 does by default, that includes Haproxy and many other HTTP proxies, servers and clients. However it DOES NOT guarantee that your entire application session will be in one single connection.
Attaching application data (like authentication details or other session related data) to a specific connection is not HTTP compliant, because it will break when that connection is closed (either on the server side, or the client side), and this is exactly what Microsoft did with NTLM and why it requires special treatment.
If you go down this road, you will have problems with HTTP proxying ever step of the way. You can’t use a CDN, you can’t use most of the HTTP proxies, etc. There are workarounds for this in haproxy, so your application won’t brake. But you are not compliant with the HTTP standard and your entire setup requires specific non-standard tweaks in order to not break your application.
For example, you would not be able to put this behind Cloudflare (this is just a example of what a quick google search turned up):
https://support.cloudflare.com/hc/en-us/articles/219192997-Does-Cloudflare-Support-NTLM-and-Kerberos-Authentication-
Yes indeed in our discussion the term persistence is ambiguous. “HTTP persistence” is HTTP keep-alive, allowing multiple transactions per connection. But when you see the term persistence in the documentation it is really not about keep-alive, but about (application) session persistence (backend server stickiness).
When you are looking for multiple transactions per connection, that is really what we call “(HTTP) keep-alive”.
And when I say transaction what I mean is a request and its corresponding response (just so we are clear on that term).
No, the entire point of this option is to combine it with (the default) keep-alive mode, and it does not close the connection. I’ve linked to the documentation about this option in my first reply and the documentation will respond these questions. It’s a soft preference change though, intended to enhance keep-alive efficiency, not to workaround layering violations such as NTLM … (see below).
No, that would be server stickiness, and could be referred to in the document with the term persistence (which again doesn’t actually refer to HTTP persistence = keep-alive, but backend server persistence, as in “this application session must be sticky to server 123, otherwise the application will break”).
Again prefer-last-server is a “soft” preference change, meaning that haproxy can still break the connection for a variety of reasons. You can use option http-tunnel to disable the entire keep-alive logic in haproxy after the first transaction, which basically transforms it into a TCP tunnel afterwards. Or your can just use TCP mode.
The best configuration for you depends on what features you actually require from haproxy. If you just want to connect a TCP port on one side to a TCP port on the other side, than TCP mode is what you should use. If you require any HTTP related features, like compression, ACLs, content switching, etc you will require HTTP mode (and not http-tunnel either, as that one only considers only the first transaction of the connection).