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...
dragonflymr
Cirrostratus
Jun 07, 2017Hi,
Maybe try getfield for that:
if { [HTTP::header "Cache-Control" exists] } {
set new_hdr set new [getfield [HTTP::header "Cache-Control"] "," 1]
HTTP::header replace "Cache-Control" $new_header
}Not the best code but should work. Probably it would be good to check if there are no multiple instances of Cache-Control header because above code will replace value only in last instance of header.
pro
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