Forum Discussion
Irule help
Folks
i am looking irule which help me on below requirement
TCP/HTTP session has to be gracefully closed when we get response from server as 204
is below irule can help
when HTTP_RESPONSE_RELEASE {
if { [HTTP::status] == 204 }{
log local0. "HTTP close"
HTTP::close
log local0. "TCP close"
TCP::close
}
}
- Andy_McGrath
Cumulonimbus
I wouldn't close the HTTP session in the event
as the HTTP response is about to be released from the F5 to the client but I would use theHTTP_RESPONSE_RELEASE
event.HTTP_RESPONSE
If you need to ensure it is the last
event then you can add a priority of 900 e.g.HTTP_RESPONSE
when HTTP_RESPONSE priority 900 {
I do not think you need to close the TCP session else you will not send a response to the client at all and the command
should close the connection after sending the response with the inserted header Connection: Close.HTTP::close
when HTTP_RESPONSE { if {[HTTP::status] == 204}{ log local0. "HTTP close" HTTP::close } }
Finally HTTP is stateless so even if the browser closes the TCP connection down following the response header Connection: Close being received it will likely just open a new one if it has another request to send. So this is removing the use of Connection: keep-alive from the client.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com