Forum Discussion
yves_werniers_1
Nimbostratus
Jun 08, 2010irule stream::exporession and data group list
Hello,
I would like to rewrite responses from webservers to add a part to the url (in certain cases). Is it possible to use the stream::expression with data group lists? Like that, I could m...
yves_werniers_1
Nimbostratus
Jun 09, 2010Hello all,
thanks for all the input. What I finally put together:
I created 2 data group lists testin and testout
I linked the default stream profile to my virtual server, as well as the below irule.
when HTTP_RESPONSE {
set listlengte [llength [class get testin]]
set streamexpression ""
foreach {stringin} [class get testin] {stringout} [class get testout]
{
set streamexpression [concat $streamexpression "@[lindex $stringin 1]@[lindex $stringout 1]@"]
}
set streamexpression [string map {"@ @" "@@"} $streamexpression]
STREAM::expression $streamexpression
STREAM::enable
} All I need to do is to add the part that disabls chunking:
when HTTP_REQUEST {
Don't allow data to be chunked
if {
[HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}Is there anyone that can estimate the impact (performance wise) of an iRule like this? I used the foreach instead of the 'heavier' for loop, and I used string map instead of string replace, so I would expect it to be 'as light as possible'. If anyone can think of ways to make it even lighter, please let me know.
Yves
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
