I'm trying to make Google PageSpeed happy, but my .htaccess skills are limited. I'm particularly struggling with browser and proxy caching. Does anyone have a template I can use?
Here's what I have for compression so far:
# JavaScript MIME type issues:
# 1. Apache uses "application/javascript": http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
# 2. IIS uses "application/x-javascript": http://technet.microsoft.com/en-us/library/bb742440.aspx
# 3. SVG specification says it is text/ecmascript: http://www.w3.org/TR/2001/REC-SVG-20010904/script.html#ScriptElement
# 4. HTML specification says it is text/javascript: http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html#h-18.2.2.2
# 5. "text/ecmascript" and "text/javascript" are considered obsolete: http://www.rfc-editor.org/rfc/rfc4329.txt
#==================================================================================================
# Compression: http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression
#==================================================================================================
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# The following MIME types are in the process of registration
AddOutputFilterByType DEFLATE application/xslt+xml
AddOutputFilterByType DEFLATE image/svg+xml
# The following MIME types are NOT registered
AddOutputFilterByType DEFLATE application/mathml+xml
AddOutputFilterByType DEFLATE application/rss+xml
# Compress JavaScript; make sure to list all possible MIME types for JavaScript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/ecmascript
AddOutputFilterByType DEFLATE text/javascript
</IfModule>
#--------------------------------------------------------------------------------------------------