JN_42992
May 27, 2010Nimbostratus
http response not always fired
Hi,
I have the iRule below deployed on a chassis running 9.3.1 (latest HF).
This iRule does not always work. In fact, after some debugging, I noticed that HTTP_RESPONSE is not always fired. Any idea why?
Is this rule not written correctly?
rule rule-client-cache-static-objects {
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::path]] starts_with $::staticcacheable] } {
set cacheHeader 1
} else {
set cacheHeader 0
}
log local0. "[HTTP::host][HTTP::path] cacheHeader is $cacheHeader"
}
when HTTP_RESPONSE {
log local0. "HTTP_RESPONSE fired, cacheHeader is $cacheHeader"
if {$cacheHeader} {
HTTP::header replace Cache-Control "public,max-age=3600"
}
HTTP::header remove Etag
} }
staticcacheable is a list of URI like /js/, /css/, ... It has about 10 items.
Thanks