Forum Discussion
tonio_tian_1127
Nimbostratus
May 13, 2005how to using iRules to optimize persist???
There are five pools in my rule, When http request that switched on the URI to select the pool.When select the pool exdous_http_pool. It’s has cookie persistence requirements.If selece other pool,It’s not has persistence requirements,
So I write the rule:
when HTTP_REQUEST {
if {[HTTP::host] equals "china.ali.com" }
{
if {[HTTP::uri] equals "/"}
{persist none
pool old_statics}
elseif {[HTTP::uri] equals "/index.html"}
{persist none
pool old_statics}
elseif {[HTTP::uri] contains "sell"}
{persist none
pool statics}
elseif {[HTTP::uri] contains "buy"}
{persist none
pool statics}
elseif {[HTTP::uri] contains "/athena/turbine"}
{persist none
pool athena_ali}
elseif {[HTTP::uri] contains "mysite"}
{persist none
pool athena_ali}
elseif {[HTTP::uri] contains "img"}
{persist none
pool img_http_pool}
elseif {[HTTP::uri] contains "trust"}
{persist none
pool statics}
else {persist cookie insert mycookies
pool exdous_http_pool}
}
else {persist cookie insert mycookies
pool exdous_http_pool}
}
As a result, soever select anypool It always do persistence .what’s error in my rule??
3 Replies
Sort By
- tonio_tian_1127
Nimbostratus
has anyone done this before and maybe supply some code? help oh help !! - unRuleY_95363Historic F5 AccountOk, I can only see one potential issue. Tcl is very picky about where the opening brace '{' is after an if statement. The Tcl syntax requires it to be on the same line as the if. We attempted to relax this requirement, however, we didn't account for whitespace that may follow the if line. So, first try modifying your rule so that the opening brace '{' starts at the end of the line.
- tonio_tian_1127
Nimbostratus
thanks for you read my of a kind english and reply !!!
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