Forum Discussion
Kai_Wilke
Feb 10, 2016MVP
Hi OTS02,
in the past I've seen some really strage behavior, when using unquoted conditions containing "-" signs. Well, it should work, but somehow its doesn't work well everytime...?
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool HIGH_SPEED_LOGGING]
}
when HTTP_REQUEST {
HSL::send $hsl "REQUEST HEADERS = [HTTP::header names]"
if { [set since_modded [HTTP::header value "If-Modified-Since"]] ne "" } {
HSL::send $hsl "If-Modified-Since exists: CACHE DISCOVERY $since_modded "
}
if { [set none_match [HTTP::header value "If-None-Match"]] ne "" } {
HSL::send $hsl "If-None-Match exists: CACHE DISCOVERY $none_match "
}
}
Note: I've tweaked your iRule a little bit to increase its performance. Its now using the CLIENT_ACCEPTED event to define the HSL connection and using a [set since_modded [HTTP::header value "If-Modified-Since"]] ne "" syntax to check for existence ( header ne "" is faster then header exists) and store the results in a single step. Well, the code could be further optimized by skipping the $variable creation at all, but I assume you need to process the results further...
Cheers, Kai