{"id":21020,"date":"2021-12-22T17:39:23","date_gmt":"2021-12-22T17:39:23","guid":{"rendered":"https:\/\/supporthost.com\/?post_type=tutorial&#038;p=21020"},"modified":"2024-05-15T16:37:23","modified_gmt":"2024-05-15T16:37:23","slug":"gzip-compression","status":"publish","type":"tutorial","link":"https:\/\/supporthost.com\/tutorial\/gzip-compression\/","title":{"rendered":"Enable gzip compression"},"content":{"rendered":"\n<p>Resource compression is something you should never overlook, having a <a href=\"https:\/\/supporthost.com\/fast-website\/\" data-type=\"post\" data-id=\"16715\">fast website<\/a> is important to ensure your users have an optimal browsing experience.<\/p>\n\n\n\n<p>With this tutorial you can learn how to enable Gzip compression on your website making its loading times faster.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-gzip-compression\">What is Gzip compression<\/a><ul><li><a href=\"#why-use-gzip-compression\">Why use Gzip compression?<\/a><\/li><\/ul><\/li><li><a href=\"#how-to-enable-gzip-compression-with-c-panel\">How to enable Gzip compression with cPanel<\/a><ul><li><a href=\"#how-to-disable-gzip-compression\">How to disable Gzip compression<\/a><\/li><\/ul><\/li><li><a href=\"#check-compression-status\">Check compression status<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-gzip-compression\">What is Gzip compression<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.gzip.org\/\" rel=\"noopener\">Gzip<\/a> is a file compression tool used to reduce the size of many resources such as, for example, HTML files, style sheets, scripts, web fonts.<\/p>\n\n\n\n<p>Compression of a file is nothing but the process of reducing its size by means of compression algorithms.<\/p>\n\n\n\n<p>When you connect to a web site, your browser tells the web server that it can accept compressed files. The web server processes this information and checks to see if file compression is enabled.<\/p>\n\n\n\n<p>If Gzip compression is enabled, your browser will receive a <strong>page with a smaller size than the original <\/strong>one, otherwise it will get an uncompressed page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"why-use-gzip-compression\">Why use Gzip compression?<\/h3>\n\n\n\n<p>Optimizing resource size is useful to save bandwidth. By reducing the size of files, it will take less time for your site&#8217;s users to view its content.<\/p>\n\n\n\n<p>If you want to <a href=\"https:\/\/supporthost.com\/speed-up-wordpress\/\" data-type=\"post\" data-id=\"16758\">speed up your WordPress site<\/a>, enabling Gzip compression can help you <strong>improve loading times<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-enable-gzip-compression-with-c-panel\">How to enable Gzip compression with cPanel<\/h2>\n\n\n\n<p>You can enable Gzip compression on all our <a href=\"https:\/\/supporthost.com\/shared-hosting\/\" data-type=\"page\" data-id=\"16336\">shared hosting<\/a>, <a href=\"https:\/\/supporthost.com\/semidedicated-hosting\/\" data-type=\"page\" data-id=\"16337\">semidedicated hosting <\/a>and <a href=\"https:\/\/supporthost.com\/wordpress-hosting\/\" data-type=\"page\" data-id=\"16339\">WordPress hosting<\/a> plans very quickly, directly from cPanel.<\/p>\n\n\n\n<p>After <a href=\"https:\/\/supporthost.com\/tutorial\/cpanel-login\/\" data-type=\"tutorial\" data-id=\"16503\">logging into cPanel<\/a>, search and select &#8220;<em>Optimize Website<\/em>&#8221; in the <em>Software <\/em>section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"233\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website-1024x233.png\" alt=\"Cpanel Optimize Website\" class=\"wp-image-21022\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website-1024x233.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website-300x68.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website-768x175.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website-120x27.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/cpanel-optimize-website.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Selecting the &#8220;<strong>Compress all content<\/strong>&#8221; option will compress all the resources on your website.<\/p>\n\n\n\n<p>The &#8220;<em>Compress specified MIME types<\/em>&#8221; option, on the other hand, will allow you to manually select the resources to which compression is to be applied.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"277\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content-1024x277.png\" alt=\"Gzip Compression Compress All Content\" class=\"wp-image-21023\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content-1024x277.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content-300x81.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content-768x208.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content-120x32.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/gzip-compression-compress-all-content.png 1086w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you decide to enter values manually, you can browse a list of the most <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Basics_of_HTTP\/MIME_types\/Common_types\" rel=\"noopener\">common MIME types <\/a>to choose the ones that best suit your needs, or you can browse the complete and up-to-date list of all <a href=\"https:\/\/www.iana.org\/assignments\/media-types\/media-types.xhtml\" rel=\"noopener\">Media Types<\/a>.<\/p>\n\n\n\n<p>After applying the changes, press the &#8220;<em>Update Information<\/em>&#8221; button to make the changes take effect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-disable-gzip-compression\">How to disable Gzip compression<\/h3>\n\n\n\n<p>If after enabling compression you notice problems with viewing or functioning on your website you may decide that you want to temporarily disable Gzip compression.<\/p>\n\n\n\n<p>You can do this by selecting the &#8220;<em>Disabled<\/em>&#8221; field and pressing the &#8220;<em>Update Settings<\/em>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"234\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression-1024x234.png\" alt=\"Disable Gzip Compression\" class=\"wp-image-21025\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression-1024x234.png 1024w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression-300x69.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression-768x175.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression-120x27.png 120w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/disable-gzip-compression.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"check-compression-status\">Check compression status<\/h2>\n\n\n\n<p>You can check the status of Gzip compression quickly using your browser&#8217;s developer tools.<\/p>\n\n\n\n<p>Open the developer tools and select the &#8220;<em>Network<\/em>&#8221; tab. From this area you can see all the resources that are being interpreted by your browser.<\/p>\n\n\n\n<p>By clicking on a resource, you can analyze the details of http requests and responses.<\/p>\n\n\n\n<p>If, among the <em>response headers, <\/em>&#8220;<strong>content-encoding<\/strong>&#8221; says <strong>gzip<\/strong>, it means that the resources of your website have been correctly compressed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"452\" src=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/content-encoding-gzip.png\" alt=\"Content Encoding Gzip\" class=\"wp-image-21026\" srcset=\"https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/content-encoding-gzip.png 787w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/content-encoding-gzip-300x172.png 300w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/content-encoding-gzip-768x441.png 768w, https:\/\/supporthost.com\/wp-content\/uploads\/2021\/12\/content-encoding-gzip-110x63.png 110w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/figure>\n\n\n\n<p>On the contrary, if you do not find any entry in the <em>response headers<\/em>, it means that the files have not been compressed.<\/p>\n","protected":false},"author":1,"featured_media":43777,"template":"","tutorial-cat":[17],"class_list":["post-21020","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","tutorial-cat-advanced"],"acf":[],"_links":{"self":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial\/21020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial\/21020\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/media\/43777"}],"wp:attachment":[{"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/media?parent=21020"}],"wp:term":[{"taxonomy":"tutorial-cat","embeddable":true,"href":"https:\/\/supporthost.com\/wp-json\/wp\/v2\/tutorial-cat?post=21020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}