Forum Discussion
Tarik_B_
Nimbostratus
Jun 07, 2017iRule removes second value of header cache-control
Hi all,
I'm trying to remove all values after the comma of cache-control header
cache-control: no-cache, max-age=0
For instance here I want to keep
cache-control: no-cache, it is not...
Morten_Marstran
Nimbostratus
Jun 07, 2017Regarding Piotr's comment on checking for multiple instances of "Cache-Control", you could use HTTP::remove and then HTTP::insert, like this:
if { [HTTP::header "Cache-Control" exists] } {
set new_header [getfield [HTTP::header "Cache-Control"] "," 1]
HTTP::header remove "Cache-Control"
HTTP::header insert "Cache-Control" $new_header
}
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