Remember mod_images_never_expire?
Well Today I wrote mod_never_expire . Its pretty much the same idea, but its a little more configurable, and for files it sets long expire and cache-control headers…. And it works in httpd 2.x
To use, you just use any Directory/Location/Files container, and tur it on:
<LocationMatch ^/c/css/r\d+/.+\.css>
NeverExpire on
</LocationMatch>
or:
<Directory "/foo/bar/js/">
NeverExpire on
</Directory>
Great for Images, CSS, and Javascript, as long as you properly version your URLs.
Excellent. Also see brief discussion here on immutability:
http://www.mnot.net/blog/2007/05/15/expires_max-age
Did you look at mod_expires ?
http://httpd.apache.org/docs/2.0/mod/mod_expires.html
I did, but it has two main problems:
1. It’s complicated.
2. It by default wants to work per-content Content-Types, when really for me, everything under a directory path is what matters.
By default you can make it work by directory if you want :
ExpiresActive Off
ExpiresDefault “access plus 10 years”
ExpiresActive On
Sorry your blog skipped my directory directive :
ExpiresActive Off
ExpiresDefault “access plus 10 years”
< Directory “/foo/bar/js/” >
ExpiresActive On
< /Directory >
I hope you have some tests