Apache Caching and Compression

It is very important to turn on caching and compression in your web server to improve the overall feel of your site. Not to mention that the biggest Search Engine in the world now considers your page speed when ranking it. So, quite simply add the following to apache which will turn on caching and compression for everything. You might want to tweak the text/html setting or even remove it completely if you have a site that is being updated all the time.

<Location />
    # CACHING with MOD_EXPIRES
    # Set expire time for files by mime type
    ExpiresActive On
    ExpiresByType text/html "access plus 1 hour"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    # COMPRESSION with MOD_DEFLATE
    # Insert filter
    SetOutputFilter DEFLATE
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    Header append Vary User-Agent env=!dont-vary
</Location>
Burtronix Banner W3C Banner