Forum Discussion
Kevin_Stewart
Aug 10, 2013Employee
Well, you definitely want an OR structure, but honestly I think an if/elseif would be a better choice here. You only have 2 conditions and a switch context would require nesting another switch in the default condition of the parent switch, and then another switch nested in the default condition of that switch. Generally speaking, a switch is faster when you're comparing large sets of values, compared to an if/elseif, but with only 2 conditions I think you'd be hard pressed to see a difference in performance.
if { [string tolower [HTTP::uri]] contains "/application/" } {
pool this_pool
} elseif { [HTTP::cookie exists foo-cookie] } {
pool that_pool
} else {
pool default_pool
}