Forum Discussion
Wil_Schultz_101
Nimbostratus
Jan 26, 2007Possible to insert header in CACHE_RESPONSE?
I would like to insert a header on cache response so I will quickly know if a page was served from the origin server of from cache. I'm attempting the following:
when CACHE_RESPONSE {
if { [HTTP::uri] contains "/" } {
HTTP::header insert "Via" "Cache"
log local.cachedresponse
}
}
And am receiving the following error:
tmm tmm[1025]: 01220001:3: TCL error: Rule testirule - Out of bounds (line 2) invoked from within "HTTP::header insert Via: BigIP"
5 Replies
- bl0ndie_127134Historic F5 AccountYou can but you will have to get version 9.4; sorry.
- Wil_Schultz_101
Nimbostratus
So I've tested with the following:when HTTP_RESPONSE { HTTP::header insert "Server" "Cache" }
- bl0ndie_127134Historic F5 AccountI agree that's a bit of a pia. Are you making the caching decision in HTTP_REQUEST? A lot of folks use data groups to call CACHE::enable of CACHE::disable command to manually enable/disable the cache. If you are also doing that, you could just set a variable as a hint whether or not to add the header on the response. Other wise you will have to get 9.4.
- rb1980_75708
Nimbostratus
so how do you do it in 9.4? - bl0ndie_127134Historic F5 AccountTry CACHE::header insert
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