{"id":708,"date":"2017-05-06T14:38:31","date_gmt":"2017-05-06T14:38:31","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=708"},"modified":"2024-11-05T13:20:35","modified_gmt":"2024-11-05T13:20:35","slug":"enable-gzip-compression","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/enable-gzip-compression\/","title":{"rendered":"How to enable GZIP compression"},"content":{"rendered":"<p>In this tutorial, you will learn how to enable GZIP compression for your website. <strong>GZIP<\/strong> compresses your web pages and style sheets before sending them over to the browser. This drastically reduces transfer time since the files are much smaller.<\/p>\n<p>Enabling Gzip compression isn&#8217;t difficult at all! All you need to do is add the following piece of code to your site&#8217;s .htaccess file:<\/p>\n<pre>&lt;IfModule mod_deflate.c&gt;\r\n # Compress HTML, CSS, JavaScript, Text, XML and fonts\r\n AddOutputFilterByType DEFLATE application\/javascript\r\n AddOutputFilterByType DEFLATE application\/rss+xml\r\n AddOutputFilterByType DEFLATE application\/vnd.ms-fontobject\r\n AddOutputFilterByType DEFLATE application\/x-font\r\n AddOutputFilterByType DEFLATE application\/x-font-opentype\r\n AddOutputFilterByType DEFLATE application\/x-font-otf\r\n AddOutputFilterByType DEFLATE application\/x-font-truetype\r\n AddOutputFilterByType DEFLATE application\/x-font-ttf\r\n AddOutputFilterByType DEFLATE application\/x-javascript\r\n AddOutputFilterByType DEFLATE application\/xhtml+xml\r\n AddOutputFilterByType DEFLATE application\/xml\r\n AddOutputFilterByType DEFLATE font\/opentype\r\n AddOutputFilterByType DEFLATE font\/otf\r\n AddOutputFilterByType DEFLATE font\/ttf\r\n AddOutputFilterByType DEFLATE image\/svg+xml\r\n AddOutputFilterByType DEFLATE image\/x-icon\r\n AddOutputFilterByType DEFLATE text\/css\r\n AddOutputFilterByType DEFLATE text\/html\r\n AddOutputFilterByType DEFLATE text\/javascript\r\n AddOutputFilterByType DEFLATE text\/plain\r\n AddOutputFilterByType DEFLATE text\/xml\r\n\r\n# Remove browser bugs (only needed for really old browsers)\r\n BrowserMatch ^Mozilla\/4 gzip-only-text\/html\r\n BrowserMatch ^Mozilla\/4\\.0[678] no-gzip\r\n BrowserMatch \\bMSIE !no-gzip !gzip-only-text\/html\r\n Header append Vary User-Agent\r\n&lt;\/IfModule&gt;<\/pre>\n<p>With this <a href=\"https:\/\/www.giftofspeed.com\/gzip-test\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>online tool<\/strong><\/a>, you can check if your web server is sending the correct GZIP enabled header.<\/p>\n<p>If GZIP or Brotli is properly enabled, the result will look like this:<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8550\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-783x470.png\" alt=\"\" width=\"790\" height=\"474\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-783x470.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-300x180.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-768x461.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-50x30.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-1536x922.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-2048x1230.png 2048w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-60x36.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Gzip-Compression-100x60.png 100w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/a><\/p>\n<p>That&#8217;s it! Now you know how to\u00a0enable GZIP compression for your website.<\/p>\n<p>If you are a ChemiCloud customer, we have you covered. GZIP compression is enabled by default on all our <strong><a href=\"https:\/\/chemicloud.com\/#choosePlan\">web hosting<\/a> <\/strong>plans.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to enable GZIP compression for your website. GZIP compresses your web pages and style sheets before sending them over to the browser. This drastically reduces transfer time since the files are much smaller. Enabling Gzip compression isn&#8217;t difficult at all! All you need&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[191],"ht-kb-tag":[],"class_list":["post-708","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-website-speed"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":5,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/708\/revisions"}],"predecessor-version":[{"id":8551,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/708\/revisions\/8551"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=708"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}