[eluser]tonydewan[/eluser]
One thing I meant to do, and never got around to, was to post the .htaccess settings I used in my production environment. This does most everything @dmorin's solution does, just differently. Don't use these in a development situation. It will make your life harder. Also, these are just the static asset optimizations. I've left out the mod_rewrite and other stuff that also goes here. (Also, credit where credit is due: I borrowed most all of these settings from someone else. I can't find the site at the moment, but somebody else did most of the work on this one.)
[code]### BEGIN gzip
# Insert filter
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress PDF
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
### END gzip
### begin etag
FileETag none
### end etag
### begin expires header
<FilesMatch "\.(ico|flv|swf|pdf|jpg|jpeg|png|gif|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 10 years"
</FilesMatch>