frischi_179414
Dec 24, 2015Nimbostratus
Riverbed iRule Performance
Hi
I have a question about an iRule we plan to implement. We cannot test it in a lab and wondered if anyone could help me with an assessment. Will we face a great performance losses or can we use this iRule without any problems?
when RULE_INIT {
set static::OPNET_jscript {
}
}
when HTTP_REQUEST {
set page_extension [string tolower [HTTP::path]]}
when HTTP_RESPONSE {
if { [HTTP::status] == 200 } {
if {[HTTP::header value Content-Type] contains "text"} {
set stream_find ""
set stream_find_lower ""
set insertJscript 1
Do not allow the Javascript insertion if the pages end with the following
switch -glob $page_extension {
"*.ashx*" -
"*.asmx*" -
"*.axd*" -
"*.js*" {
set insertJscript 0
}
default {
if { [HTTP::payload] contains "META HTTP-EQUIV=\"Refresh\""} {
set insertJscript 0
}
}
}
if {$insertJscript == 1} {
STREAM::disable
COMPRESS::disable
STREAM::expression "@$stream_find@$stream_find$static::OPNET_jscript@"
STREAM::expression "@$stream_find_lower@$stream_find_lower$static::OPNET_jscript@"
STREAM::enable
}
}
}
}
Thanks for your feedback! Best regards