Forum Discussion
Snl
Cirrostratus
Oct 24, 2018Irule 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_...
Andy_McGrath
Cumulonimbus
Oct 24, 2018I wouldn't close the HTTP session in the event
HTTP_RESPONSE_RELEASE
as the HTTP response is about to be released from the F5 to the client but I would use the HTTP_RESPONSE
event.
If you need to ensure it is the last
HTTP_RESPONSE
event then you can add a priority of 900 e.g. 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
HTTP::close
should close the connection after sending the response with the inserted header Connection: 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
DevCentral Quicklinks
* 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
Discover DevCentral Connects