Forum Discussion
JN_42992
Nimbostratus
May 27, 2010http 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
- hoolio
Cirrostratus
Hi Jean, - JN_42992
Nimbostratus
Thanks Aaron for the reply. I will keep the ramcache tips in mind for a different unit I have. - hoolio
Cirrostratus
It's a bit strange that HTTP_RESPONSE would not fire on all responses. Is this something you can reproduce? If so, can you capture a tcpdump of the client and serverside traffic and compare the responses that do trigger HTTP_RESPONSE with the ones that don't? You can use syntax like this:
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects