Forum Discussion
Lior_Cohen_2771
Nimbostratus
Aug 31, 2017iRule to modify Cache-Control Header
Hi I want to create an iRule to modify the cache control to private when sending the HTTP Respond the cache control is public so my cache system before the F5 can cache to contanet, but i dont wa...
Jad_Tabbara__J1
Cirrostratus
Aug 31, 2017Hello Lior,
Try the following irule
when HTTP_RESPONSE {
HTTP::header insert X-Cache "MISS F5-IG"
}
when CACHE_RESPONSE {
CACHE::header replace X-Cache "HIT F5-IG"
}
when HTTP_RESPONSE_RELEASE {
if {[string length [HTTP::header "Cache-Control"]]} {
set new_cache [string map -nocase {"public" "private"} [HTTP::header "Cache-Control"]]
HTTP::header replace Cache-Control $new_cache
}
}
Please give me a feedback
Thanks
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
