What is the TCP connection lifetime?

I’ve just come across the REWRITE::disable command and had a use for it with some of our stuff, and as I looked at the documentation page (here), I noticed that it says that the REWRITE will be disabled throughout the lifetime of the TCP connection.

I’m not all that familiar with this, so I was wondering if anyone could help explain to me the TCP lifecyle (e.g. if it’s similar to an HTTP request lifecycle or not), and whether if I disable this for a particular page, it will cause issues with any other pages that I’d like to continue rewriting.

Any thoughts/help would be greatly appreciated. Thanks, Michael

I’m not going into a full description, but a TCP connection may contain multiple HTTP request/responses, so if you are worried about turning it off for one request might affect others, you should be. The following code would help;-

when HTTP_RESPONSE {
  if {[HTTP::path] eq "/jangins} {
    REWRITE::disable
  } else {
    REWRITE::enable
  }
}