Forum Discussion
May 17, 2011
cache-control header response
Hello , Is there a way to set to intercept the http header response and set cache-control (i.e. set control-control: private and max-age of 7 days) for ONLY static files specified? ...
Jun 16, 2011
Thanks.
This worked for me.
if request is a static file, set cache control to be cached on the client machine for 7 days
if { [HTTP::header exists Content-Type] } {
switch -glob [HTTP::header Content-Type] {
"text/javascript" -
"text/css" {
HTTP::header replace "Cache-Control" "private, max-age=604800"
}
}
}
Regards
TRX
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