Forum Discussion
Jul 05, 2007
I'm assuming you don't need persistence for the static files. If so, something like this should work (assuming you don't care about persistence on the static requests...
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } {
persist add uie [HTTP::cookie "JSESSIONID"]
set add_persist 0
}
}
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"*.jpg" -
"*.bmp" -
"*.mp3" {
pool static_pool
}
default {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"]
} else {
set jsess [findstr [HTTP::uri] "jsessionid" 11 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}
}
Basically what this does is for all requests ending with ".jpg", ".bmp", or ".mp3", assign the traffic to the static_pool. All other requests will default back to your original logic.
-Joe