GZIP Compression

Overview

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.

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 a 800 KB page, so making sure you take advantage of compression might mean a faster-loading site.

Does ArtHost enable GZIP Compression?

ArtHost enables GZIP compression by default, so you do not need to take any further steps to turn it on for your site. However, please note that due to a security vulnerability when compression is combined with HTTPS (using a TLS/SSL  Certificate), GZIP Compression is disabled for HTTPS hosting by default.

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, ArtHost 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 any correction as needed. If you are not familiar with code in .htaccess, 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.

Alternatives to GZIP Compression for HTTPS

Cloudflare

Cloudflare is a service that provides website protection and acceleration. Cloudflare’s primary feature is its global Content Delivery Network (CDN), which provides web content optimization technologies that improve how quickly resources on your site load. All Cloudflare plans including its free plans offer Brotli compression by default, which is a newer and faster method of compression. For more information on enabling Cloudflare, please see the following article:

How to enable Cloudflare on your domain