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? ...
hooleylist
Jun 16, 2011Cirrostratus
Hi TRX,
If you define a string datagroup with the static content-types named static_content_types_class, you could use matchclass in v9 like this to do the lookup and rewrite:
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] ne ""} {
if {[matchclass [HTTP::header Content-Type] equals static_content_types_class]}{
HTTP::header replace "Cache-Control" "private, max-age=604800"
}
}
}
Aaron
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