Forum Discussion
SteveEason
Cirrus
Oct 17, 2022iRules to implement Security requirements in headers
We implemented at one point Policies to handle specific Security required header policies, however it appears they are not working currently (v16.1.3.1). The Security headers are for your typical ent...
Kevin_Stewart
Employee
Oct 17, 2022Classes are used to search data groups.
There's probably way more elegant ways to do this, but the below extracts the ending from the HTTP::path and searches through the list of endings:
when RULE_INIT {
set static::endinglist { ".jpg" ".jpeg" ".css" ".js" ".ico" ".png" ".gif" ".svg" ".bmp" ".webp" ".avif" ".jxl" ".woff2" ".ttf" ".woff" ".mp4" }
}
when HTTP_REQUEST {
if { [lsearch -all $static::endinglist [string range [HTTP::path] [string last "." [HTTP::path]] end]] ne "" } {
HTTP::header replace Cache-Control "no-cache"
}
}
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