Forum Discussion
irules optimization
- May 13, 2015
can you try something like this?
when HTTP_REQUEST { switch -glob [HTTP::host] { "*env-1" - "1.1.1.1*" { Do something } "*env-2*" - "1.1.1.2*" { Do something } default { Do something } } }
coz in the existing irules now, there are a lot of IFs and some ifs are comparing the URI (with equals, ends with, contains), some comparing variables, some comparing headers. I would like to modify the rules to be 'better', hence you recommended the switch -glob
i do not think switch is always the best. you do not need to change all condition check to switch. it should be pretty fine as long as irule is easy to understand and maintain.
Comparing iRule Control Statements by Joe Pruitt
https://devcentral.f5.com/articles/comparing-irule-control-statements
just my 2 cents.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
