Forum Discussion
IheartF5_45022
Feb 12, 2014Nacreous
When the site owners don't want to redirect to an external site, we store an html file with embedded images/js in a datagroup in the F5. We get the content from the site owners, then gzip it, then b64encode it
when LB_FAILED {
Respond with sorry page
HTTP::respond 503 Content [b64decode [class lookup "/sorry/sorry_prod.htm" dg_html_content]] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
}
I'm afraid clients which don't accept compression get an ugly response, however if you do want to cater for them and you have some content that is compressed and some that isn't;-
set res [class lookup $sorry dg_html_content]
if {[HTTP::header Accept-Encoding] contains "gzip" && $res starts_with "H4sI"} {
HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
} else {
They don't support gzip
HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Connection "close"
}