That's a lot of matchclass calls! It's hard to tell if your iRule is optimal without knowing the size and contents of your various data groups. If they are fairly small, you could make a pretty straightforward switch statement with character globbing that would replace all the matchclass calls. If you have hundreds of entries in each class, that might not be a good solution though...
If your classes are fairly small, then you could do something like this with a switch statement that would be a bit speedier.
when HTTP_REQUEST {
set method [HTTP::method]
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
switch -glob [string tolower [HTTP::uri]] {
"/nocache_iis_start_path_1*" -
"/nocache_iis_start_path_2*" -
"/nocache_iis_start_path_3*" -
"*/nocache_iis_contains_1*" -
"*/nocache_iis_contains_2*" -
"*/nocache_iis_contains_3*" -
"*/nocache_iis_endswith_1" -
"*/nocache_iis_endswith_2" -
"*/nocache_iis_endswith_3" {
CACHE::disable
log local0. iis.nocache
pool iis_pool
}
"/cache_iis_start_path_1*" -
"/cache_iis_start_path_2*" -
"/cache_iis_start_path_3*" -
"*/cache_iis_contains_1*" -
"*/cache_iis_contains_2*" -
"*/cache_iis_contains_3*" -
"*/cache_iis_endswith_1" -
"*/cache_iis_endswith_2" -
"*/cache_iis_endswith_3" {
CACHE::enable
log local0. iis.cache
pool iis_pool
}
}
}
Just continue on with your other sections...
It has been shown that for small data groups, a switch with globbing is faster. The downside is that you have to manage the paths within the iRule and not within separate data groups.
You can always turn on performance timing (see the wiki page for "timing"). When you run traffic through your iRule it will keep track of the number of clock cycles your iRule is using. This can tell you by how much one rule is faster than another.
-Joe