Forum Discussion
hooleylist
Jul 08, 2011Cirrostratus
Hi Narenda,
You could call HTTP::retry from HTTP_RESPONSE if the status is a 404. I'm not sure about clearing the persistence record though. I wonder if you could call persist none if $retries > 0 and then call persist again with the persistence method you're using.
Here's a rough example to start with:
when CLIENT_ACCEPTED {
set retries 0
}
when HTTP_REQUEST {
Don't retry requests with a payload as we don't
want to have to collect every payload to retry 404 responses
switch [HTTP::method] {
"GET" -
"HEAD" {
set request_headers [HTTP::request]
}
default {
set request_headers ""
}
}
}
when HTTP_RESPONSE {
if {$request_headers ne "" && $retries < [active_members [LB::server pool]]}{
switch [HTTP::status] {
404 {
incr retries
HTTP::retry $request_headers
}
}
}
}
Aaron