Forum Discussion

Puli's avatar
Puli
Icon for Nimbostratus rankNimbostratus
Sep 13, 2010

cost of removing a string on every request

Hi All,

 

 

have a requirement where i need to scan and remove a string from the response.

 

 

When HTTP_RESPONSE {

 

HTTP::header replace Location [sring map -nocase {"/global" ""} [HTTP::header Location]

 

}

 

 

I need to check every response and remove global string as above, so the url in browser should appear without the string global in it.

 

Using above code, cant get it to work.

 

Also

 

Wanted to find out the impact on performance. We have pretty beefy machine running F5 LTM

 

Our site gets about 80 hits per second.

 

Do i need to add a if global exist condition? or does string map does that.

 

 

Appreciate your suggestions.

 

thanks.

 

Puli.

 

 

 

2 Replies

  • yeah, I wouldn't do the replace unless global is present. Turn timing on to check the impact to your rule:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/timing.html Click Here
  • Puli's avatar
    Puli
    Icon for Nimbostratus rankNimbostratus
    ok thanks.

     

    Am trying to print the HTTP header location, but its comming in as empty.

     

     

    In the HTTP_RESPONSE

     

    when i add a check like a below like

     

     

    if { [HTTP::header Location] start_width "/global"} {

     

    log local0. "Location [HTTP::header Location]"

     

    }

     

     

    any reason you can think the location is not being sent back in the response? or maybe am not capturing the location properly ?

     

    Appreciate any insight.