This is for Apache:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
How do I do it for lighttpd?
It should acutally be quite easy with a regular expression on $HTTP["url"]
and mod_setenv
:
$HTTP["url"] =~ "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$" {
setenv.add-response-header = ( "Cache-Control" => "max-age=290304000, public" )
}
If you need to manipulate the requests or responses in more detail, you should dig into mod_magnet.
Documentation hints: