would 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

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

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

Lol - a minute too late on my response.