Forum Discussion
Moe_Jartin
Cirrus
Jan 22, 2010How to match just / uri????
I have the following irule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
/services* {
pool pool_beta-dev.blah.org_SERVICES
}
...
hoolio
Cirrostratus
Jan 25, 2010I think you'd need to do some testing to find that out for your particular rules/applications. You can use the timing command to check the average CPU cycles per event: http://devcentral.f5.com/wiki/default.aspx/iRules/timing
I don't know the inner workings for the two commands, but I'd guess that HTTP::path requires at least one more operation than HTTP::uri to parse the path from the URI. If you're checking to see if the path or URI starts with a string, I'd guess HTTP::path and HTTP::uri would take close to the same CPU cycles to do the evaluation (with HTTP::path taking just a bit more CPU time to do the extra operation). If you're doing a "contains" comparison with a URI that contains a query string, then the shorter comparison HTTP::path should be more efficient.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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