Tarik_B_
Jun 07, 2017Nimbostratus
iRule 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 necessarily no-cache,
I want to keep the first value and remove the rest.
Via an iRule I should be able to do that but as I am quite inexperienced in this field, I need your help.
This is what I already did:
when HTTP_RESPONSE {
if {[string tolower [HTTP::header]] matches_regex cache-control\s*:\s*(public|private|no-cache|no-store|no-transform|max-age\s*[=]{1}\s*[0-9]{1,8}|max-stale\s*[=]{1}\s*[0-9]{1,8}|min-fresh\s*[=]{1}\s*[0-9]{1,8}|min-vers\s*[=]{1}\s*[0-9]{1,8}|must-revalidate|proxy-revalidate|only-if-cached)\s*[\,]{1}
}
}
I don't know if I'm on the right way, so do not hesitate to propose a solution.
Regards,
Tarik