Two quick code snippets for compressing your file output with Apache’s mod_deflate (gzip). Compressing your content is a great way to improve performance by decreasing the amount of data that is sent to the client.

To compress all of the file types included in the following code, add the snippet to your site’s root .htaccess file: