Forum Discussion
jcline
Nimbostratus
7 years agoI'm trying to create an irule that will quickly redirect traffic that meets a URI and IP address list and send them to an ifile.
The rule works but it is slow to push traffic to the page about 45 seconds and some browsers are caching the page and not coming back to the original page when rule is removed. What is the best way ...
JG
Cumulonimbus
7 years agoNot sure what the performance issue is related to, but did you have large dg files?
The following will solve the caching issue for you:
when HTTP_REQUEST {
set net_code [class match -value -- [IP::client_addr] equals internal_network_dg]
set app_path [class match -value -- [string tolower [HTTP::path]] starts_with maintenance-page-path-dg]
set mytime [clock seconds]
set last_modified "[clock format $mytime -format {%a, %d %b %Y %T %Z} -gmt 1]"
set cache_control_1 "no-store, no-cache, must-revalidate, max-age=0"
set cache_control_2 "post-check=0, pre-check=0, false"
set pragma "no-cache"
if {$app_path eq "m" and $net_code ne "r"} {
HTTP::respond 200 content [ifile get HighTraffic.html] "Content-Type" "text/html" "Last-Modified" $last_modified "Cache-Control" $cache_control_1 "Cache-Control" $cache_control_2 "Pragma" $pragma Connection close
}
}.[Edited]
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
