I usually don't have to concern myself with gzipping content and the idiosyncrasies of various browsers with regard to gzip content because it's usually not an option on shared servers. However, I started thinking there must be a way to serve gzip content even on a shared server without using a module. It's just content!? After some Googling I've come up with a couples articles for doing just that:
Since I already have a build process in place it should be easy to generate the gzip files for HTML, JS and CSS. What to serve, to which browser is the problem.
Are there any other RewriteCond I should include? I can't think of any problem with gzipping HTML and CSS, are there any problems? I'm think I need a Vary header too?
Used Browsershot.org to test this setup last night and it was a complete success as far as not effecting the look of the site. IE6, IE7 and Safari looked exactly the same as Firefox. Caching? Well? That I'll have look at over time. Here's the final .htaccess file:
My host does not have mod_headers enabled nor would they enable it. The ForceType does not seem to work so I'll remove that which will let me combine the HTML and CSS FileMatchs. HTML and CSS don't need ForceType as they are sent with the correct Content-Type. Javascript however is being sent with Content-Type application/x-javascript as oppose to text/javascript which I'm not sure make a difference ... time will tell.