Forum Discussion
Skuba_85554
Nimbostratus
Feb 24, 2010would this irule impact performance?
hi
i appreciate this is only a very basic irule, but i have been asked whether or not this is overkill...
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
HTTP::redirect "https://mywebsite.com/[HTTP::uri]"
}
}
i tend to make use of the "string tolower" command out of habit to make the url's appear more tidy, but i guess it's not really necessary. a colleague has questioned whether or not applying the command to every connection could have a negative impact on performance
personally, i don't think it's a concern, but i would like to hear your opinions
thanks
3 Replies
- hoolio
Cirrostratus
Hi Skuba,
A few minor notes on the example you posted:
You're not saving the value of [string tolower [HTTP::uri]] or evaluating any switch cases. So I'm guessing you might want to redirect all requests to https://mywebsite.com with the original URI set to lower case. If that's accurate, you could use an HTTP class with the redirect to field set to:
https://mywebsite.com[string tolower [HTTP::uri]]
This should be more efficient than using an iRule. But using a simple iRule like that would not have a significant impact on CPU/memory usage.
Also, [HTTP::uri] should already include a leading forward slash, so you wouldn't want to manually insert another one between the hostname and the URI.
Aaron - L4L7_53191
Nimbostratus
I don't have numbers for you on this (but I'll bet that a few others here most certainly do), but the short answer is that this is a low-impact rule. That said, to get it even lower impact, you can use a class profile for the same functionality and I think it'll be a bit leaner resource wise. If I am wrong about this someone please correct me.
-Matt - L4L7_53191
Nimbostratus
Lol - a minute too late on my response.
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