You may be instructed to compress with GZIP to optimize the speed of your website, especially if you use tools such as GTMetrix, Pingdom, Page Speed Insights, or YSlow.
The following describes how GZIP is enabled at DreamHost.
What is GZIP Compression?
GZIP Compression is a method to help speed up the loading of websites by reducing the size of certain files for transfer from the website’s server to the visitor’s computer or device. For example, a 1 MB web page in size may only need to transfer 800 KB instead.
Loading a 1 MB page can actually be over 25% slower than loading an 800 KB page, so making sure you take advantage of compression might mean a faster-loading site.
Does DreamHost enable GZIP Compression?
DreamHost enables GZIP compression by default on all web hosting plans, so you do not need to take any further steps to turn it on for your site.
If GZIP is enabled by default, why does my site optimization tool tell me I need to compress with GZIP?
There are a few reasons why some website analyzer services may tell you that you need to compress some files with GZIP even though it is already enabled for your HTTP site. This includes:
- The URLs they report needing compression are for a third-party site, not your domain. In this case, DreamHost cannot control compression on a third-party site. To compensate, you can ask the third-party site if they can compress or create some alternative for their URLs, or you can remove the URLs from your page’s code and replace them with URLs on your own site or URLs on a third-party site that can compress those files.
- You have made your website HTTPS only, where all pages and URLs load on https:// instead of http://. Due to a security vulnerability that is described in the previous section, GZIP compression is turned off for HTTPS.
- You may have an .htaccess file on your site with code that overrides GZIP compression. If you have http:// URLs on your domain appearing as needing compression, you can review the code in your .htaccess file and make corrections as needed. If you are not familiar with the code in the .htaccess file, you can also try temporarily changing the name of .htaccess to .htaccess_off and try loading the page again. To make sure other functionality on your site doesn’t break permanently, remember to rename the .htaccess_off file back to .htaccess.