ltm rule command HTTP is keepalive
iRule(1) BIG-IP TMSH Manual iRule(1)
HTTP::is_keepalive
Returns a true value if this is a Keep-Alive connection.
SYNOPSIS
HTTP::is_keepalive
DESCRIPTION
Returns a true value if this is a Keep-Alive connection.
Syntax
HTTP::is_keepalive
* Returns a true value if this is a Keep-Alive connection. This
command is the synonymous with HTTP::header is_keepalive.
RETURN VALUE
VALID DURING
CACHE_REQUEST, CACHE_RESPONSE, HTTP_REQUEST, HTTP_REQUEST_DATA,
HTTP_RESPONSE, HTTP_RESPONSE_CONTINUE, HTTP_RESPONSE_DATA
EXAMPLES
when HTTP_RESPONSE {
if {[HTTP::is_keepalive]}{
HTTP::close
}
}
when HTTP_REQUEST {
# Force downgrade to HTTP 1.0, but still allow keep-alive connections.
# Since 1.1 is keep-alive by default, and 1.0 isn't,
# we need make sure the headers reflect the keep-alive status.
if {[HTTP::version] == "1.1"} {
if {[HTTP::is_keepalive]} {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)