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? ...
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