{"id":4589134,"date":"2022-07-26T07:42:03","date_gmt":"2022-07-26T05:42:03","guid":{"rendered":"https:\/\/wp-rocket.me\/?post_type=core_web_vitals_hub&#038;p=4589134"},"modified":"2022-09-20T12:23:52","modified_gmt":"2022-09-20T10:23:52","slug":"enable-text-compression","status":"publish","type":"core_web_vitals_hub","link":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/","title":{"rendered":"How to Enable Text Compression to Speed up Your Site"},"content":{"rendered":"<p>Enabling text compression on WordPress is one of the best performance techniques to keep your website loading fast. When you run a speed test on Google PageSpeed Insights, you may see that \u201cEnable text compression\u201d is one of the recommendations coming from Lighthouse:&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"347\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png\" alt=\"\" class=\"wp-image-4589138\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights--310x134.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights--768x333.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights--138x60.png 138w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights--207x90.png 207w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Opportunities section Lighthouse report listing all text-based resources that aren&#8217;t compressed &#8211; Source: <a href=\"https:\/\/pagespeed.web.dev\/?hl=en\">PageSpeed Insights<\/a>&nbsp;<br><\/figcaption><\/figure><p>In this article, we explain how data compression works, how to activate it on your WordPress site and how to check that it\u2019s enabled.&nbsp;<\/p><h2 class=\"wp-block-heading\">What\u2019s Data Compression<\/h2><p>Data compression is the process of reducing file sizes thanks to the LZ77 and Huffman coding algorithms before sending them to browsers. There are several compression methods such as GZIP or Brotli that play a key role in showing billions of pages to users daily.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket.png\" alt=\"Files with GZIP compression - Source: WP Rocket\n\" class=\"wp-image-4589385\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-260x195.png 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-768x576.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-80x60.png 80w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-120x90.png 120w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Files with GZIP compression &#8211; Source: <a href=\"https:\/\/wp-rocket.me\/\">WP Rocket<\/a><br><\/figcaption><\/figure><p>To give an example, that\u2019s how a compressed HTML file looks like before and after the minification process:&nbsp;<\/p><p><strong>Before Compression: 329 characters<\/strong><\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;html&gt;\n&lt;head&gt;\n    &lt;style&gt;\n    \/* my-banner for desktop only *\/\n    .my-banner { font-size: 150% }\n    .my-banner { width: 75% }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;!-- my banner START --&gt;\n    &lt;div&gt;...&lt;\/div&gt;\n    &lt;!-- my banner END --&gt;\n    &lt;script&gt;\n    my Scripts(); \/\/ just some scripts used on the web page\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre><p><strong>With GZIP Compression: 142 characters<\/strong><\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;html&gt;&lt;head&gt;&lt;style&gt;.my-banner{font-size:160%;width:65%}&lt;\/style&gt;&lt;\/head&gt;&lt;body&gt;&lt;div&gt;...&lt;\/div&gt;&lt;script&gt;myScripts();&lt;\/script&gt;&lt;\/body&gt;&lt;\/html&gt;\n<\/code><\/pre><p>Let\u2019s go over the 2 types of compression algorithms recognized by Lighthouse, namely:<\/p><ol class=\"wp-block-list\"><li><a href=\"#gzip-compression\">GZIP Compression<\/a><\/li><li><a href=\"#brotli-compression\">Brotli Compression<\/a><\/li><\/ol><h3 class=\"wp-block-heading\" id=\"gzip-compression\">What&#8217;s GZIP Compression?<\/h3><p>GZIP is an open-source compression algorithm that locates and removes the duplicate characters in your text files. It aims at compressing web pages on the server-side and decompressing them in the browser. The goal is to reduce the file size of your site (HTML, JS, and CSS) to get faster code.<\/p><p>According to W3Techs.com, 88.2% of the websites on the internet use compression, and 52.7% of all websites use GZIP.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"171\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com-.png\" alt=\"GZIP compression on the internet (July 2022) - Source: W3techs.com\n\" class=\"wp-image-4589401\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com--310x66.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com--768x164.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com--190x41.png 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-on-the-internet-July-2022-Source-W3techs.com--421x90.png 421w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP compression on the internet (July 2022) &#8211; Source: <a href=\"https:\/\/w3techs.com\/technologies\/details\/ce-gzipcompression\">W3techs.com<\/a><br><\/figcaption><\/figure><h3 class=\"wp-block-heading\" id=\"brotli-compression\">What&#8217;s Brotli Compression?<\/h3><p>Similar to GZIP, Brotli is a compression algorithm developed by Google allowing text compression of a web page. Brotli was designed from the beginning to compress streams on the fly. Overall, Brotli is faster at compressing content on the server and decompressing it in the browser than in GZIP.<\/p><p>Do you want to see <a href=\"https:\/\/wp-rocket.me\/blog\/brotli-vs-gzip-compression\/\">a more in-depth comparison between GZIP and Brotli<\/a>? Check our guide!<\/p><h2 class=\"wp-block-heading\">How GZIP Compression Works<\/h2><p>Data compression follows the same process for each web page on the internet. With the help of LZ77 and Huffman encoding, the whole technique can be broken down into 5 key steps:&nbsp;<\/p><ol class=\"wp-block-list\"><li>When a server receives a request for a web page, it checks the header of the request to determine if the browser supports GZIP.<\/li><li>If it does, the server generates the markup for the web page and then applies GZIP.<\/li><li>GZIP converts the markup into a compressed data stream, which is then transferred to the browser.<\/li><li>When the browser receives the stream, it decompresses it and displays it to the user.<\/li><li>What if the browser doesn\u2019t support GZIP? The web server serves up an uncompressed data stream.<\/li><\/ol><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-.png\" alt=\"How data compression works  - Source: WP Rocket\n\" class=\"wp-image-4589423\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket--260x195.png 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket--768x576.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket--80x60.png 80w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/How-data-compression-works-Source-WP-Rocket--120x90.png 120w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>How data compression works&nbsp; &#8211; Source: <a href=\"https:\/\/wp-rocket.me\/\">WP Rocket<\/a><br><\/figcaption><\/figure><p>To go a little bit further in our explanation, let\u2019s understand how the LZ77 and Huffman encoding work.&nbsp;<\/p><p>First, GZIP compression runs the LZ77 algorithm to remove redundancies in a small section of the raw data:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1.png\" alt=\"GZIP compression running the LZ77 algorithm - Source: WP Rocket\" class=\"wp-image-4589430\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1-260x195.png 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1-768x576.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1-80x60.png 80w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-LZ77-algorithm-Source-WP-Rocket-1-120x90.png 120w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP compression running the LZ77 algorithm &#8211; Source: <a href=\"https:\/\/wp-rocket.me\/\">WP Rocket<\/a><\/figcaption><\/figure><p>Then, the GZIP compressor uses the Huffman coding algorithm to compress it even further. The characters occurring more frequently get the least number of bits, while more rare characters get the highest number of bits:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket.png\" alt=\"GZIP compression running the HUFFMAN encoding - Source: WP Rocket\" class=\"wp-image-4589436\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket-260x195.png 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket-768x576.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket-80x60.png 80w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-running-the-HUFFMAN-encoding-Source_-WP-Rocket-120x90.png 120w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP compression running the HUFFMAN encoding &#8211; Source: <a href=\"https:\/\/wp-rocket.me\/\">WP Rocket<\/a><\/figcaption><\/figure><p>Finally, if you want to see a real-life example Kinsta made an interesting explanation with the word \u201cBookkeeper\u201d.&nbsp;<\/p><p>It has 10 characters but only 6 unique ones (2 \u201co\u201d, 3 \u201ce\u201d etc.).&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"278\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta-.png\" alt=\"Duplicate characters in \u201cbookkeeper\u201d - Source: Kinsta \n\" class=\"wp-image-4589445\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta--310x108.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta--768x267.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta--173x60.png 173w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Duplicate-characters-in-bookkeeper-Source-Kinsta--259x90.png 259w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Duplicate characters in \u201cbookkeeper\u201d &#8211; Source: <a href=\"https:\/\/kinsta.com\/\">Kinsta<\/a>&nbsp;<br><\/figcaption><\/figure><p>The Huffman coding algorithm losslessly compresses the whole text string by generating a binary tree with every unique letter as a leaf. It gives a binary code to each character according to its frequency:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"409\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta-.png\" alt=\"Huffman algorithm gives unique binary codes for every character - Source: Kinsta \n\" class=\"wp-image-4589452\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta--310x158.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta--768x393.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta--117x60.png 117w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Huffman-algorithm-gives-unique-binary-codes-for-every-character-Source-Kinsta--176x90.png 176w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Huffman algorithm gives unique binary codes for every character &#8211; Source: <a href=\"https:\/\/kinsta.com\/\">Kinsta<\/a>&nbsp;<br><\/figcaption><\/figure><p><strong>Result: GZIP saved us almost 70% of memory. It went from 80 bits to 25 bits, thanks to the Huffman conversion.<\/strong><\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"180\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta-.png\" alt=\"Bookkeeper: 80 bits word encoded as a 25 bits string thanks to the Huffman algorithm  - Source: Kinsta \n\" class=\"wp-image-4589464\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta--310x70.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta--768x173.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta--190x43.png 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Bookkeeper-80-bits-word-encoded-as-a-25-bits-string-thanks-to-the-Huffman-algorithm-Source-Kinsta--400x90.png 400w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Bookkeeper: 80 bits word encoded as a 25 bits string thanks to the Huffman algorithm&nbsp; &#8211; Source: <a href=\"https:\/\/kinsta.com\/\">Kinsta<\/a>&nbsp;<br><\/figcaption><\/figure><div id=\"om-nyrydv5iync8zrrulm5i-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'nyrydv5iync8zrrulm5i')<\/script><h2 class=\"wp-block-heading\">How Data Compression Impacts on Performance<\/h2><p>Data compression has a positive effect on the performance of your WordPress site. Enabling text compression allows you to serve smaller text-based resources to your users. Smaller files mean faster files to download. As a result, visitors will be happy because they don\u2019t have to wait to view the content on your page.&nbsp;<\/p><p><a href=\"https:\/\/web.dev\/optimizing-content-efficiency-optimize-encoding-and-transfer\/\">A study on Web.Dev<\/a> shows how GZIP compression affects the most popular JavaScript and CSS frameworks. The results are impressive: GZIP compression can produce savings of 65-88%.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"571\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev-.png\" alt=\"GZIP compression savings - Source: Web.dev\n\" class=\"wp-image-4589471\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev--273x195.png 273w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev--768x548.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev--84x60.png 84w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-savings-Source-Web.dev--126x90.png 126w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP compression savings &#8211; Source: <a href=\"https:\/\/web.dev\/optimizing-content-efficiency-optimize-encoding-and-transfer\/\">Web.dev<\/a><br><\/figcaption><\/figure><h3 class=\"wp-block-heading\">Performance Impact of GZIP compression on FID, LCP, and FCP<\/h3><p>Data compression also impacts some of the <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\">Core Web Vitals<\/a>, three key metrics developed by Google to measure performance and the overall user experience of a web page. Amongst them, we have the <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/\">Largest Contentful Pain<\/a>t (LCP), the <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-first-input-delay\/\">First Input Delay<\/a> (FID), and the <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-cumulative-layout-shift\/\">Cumulative Layout Shift<\/a> (CLS). Another performance metric worth mentioning is the <a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/improve-first-contentful-paint\/\">First Contentful Paint<\/a> (FCP). You\u2019ll understand why in the next paragraph.<\/p><p>First of all, let\u2019s understand what those performance metrics are for.&nbsp;<\/p><p>LCP measures how long it takes for the main elements to load, FCP is about the first appearance of any content, and FID concerns browser responsiveness to a user action.&nbsp;<\/p><p>Now, you may wonder what\u2019s the correlation between the three metrics and GZIP compression. Well, those metrics measure <em>when<\/em> the data will be available to a user. So if you compress that data, you get lighter files that are available faster for the user.<strong> In fact,<\/strong> <strong>GZIP compression boosts your FID, FCP, and LCP scores by serving smaller files to the browser.<\/strong> As a result, the metrics are more likely to be in their respective green threshold when you are using compression.&nbsp;<\/p><h3 class=\"wp-block-heading\">Data Compression Impact on Lighthouse Performance Scores<\/h3><p>The GZIP compression algorithm can reduce the size of resources by up to 90%! As a result, you&#8217;ll reduce the page loading times by up to 50% and pass the specific audit on PageSpeed Insights.&nbsp;<\/p><h2 class=\"wp-block-heading\">How to Check if GZIP Compression is Enabled and is Working<\/h2><p>Before enabling GZIP on your site, it\u2019s a good idea to check if it\u2019s already switched on. There are different ways to check if your host supports GZIP compression. We\u2019ll go over four of them.&nbsp;<\/p><ol class=\"wp-block-list\"><li><a href=\"#speed-tests\">Speed Tests (PSI, GTmetrix, etc&#8230;)<\/a><\/li><li><a href=\"#online-gzip-compression-tool\">Online GZIP Compression Tools<\/a><\/li><li><a href=\"#content-enconding-gzip\">Check The \u201ccontent-encoding: gzip\u201d Response Header in Developer Tools<\/a><\/li><li><a href=\"#phpinfo-file\">Create a phpinfo File<\/a><\/li><\/ol><p>Let\u2019s go over them!&nbsp;<\/p><h3 class=\"wp-block-heading\" id=\"speed-tests\">1. Speed Tests on Lighthouse (PSI, GTmetrix, etc&#8230;)<\/h3><p>To check if GZIP compression is enabled and working, you can use performance tools like <a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/\">PageSpeed Insights<\/a> or GTmetrix. In their audit sections, if some text-based content is not compressed, the following audit will be triggered:&nbsp;<\/p><figure class=\"wp-block-table\"><table><tbody><tr><td>Audit section on PSI<\/td><td>Audit section on GTmetrix<\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/6tEd_bdKoXMJtsIeP0dS8MRCd2gPMDa1H225xBn5qCeP80zNnmyOMhuo0zG2d72S8i8iBOAjm71tttKuhcHfhIrRftyxrPVEi4LD7yvahCxlCrm-xbw5oukSZ7TWCo8m5waqHJViv6JbAjbTOpi-Q3Y\" width=\"286\" height=\"135\"><\/td><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/mEd7YUC9LZq1Bm1Z2EGk-LNy6w07Rsca_MbUzIHDeSllO9wF9tkWMBwhyvA_OhJfSiTcC6WM5doDwd_MNEmsTSp_LzrzY9b8ZtWfwlQDeuZyykBFLiGLjlWuJrZJ1C4jTZPOTw26maq5SmEp6wupVnI\" width=\"286\" height=\"143\"><\/td><\/tr><\/tbody><\/table><\/figure><h3 class=\"wp-block-heading\" id=\"online-gzip-compression-tool\">2. Online GZIP Compression Tool<\/h3><p>The easiest way to check if your site has GZIP enabled is to head over to <a href=\"https:\/\/www.giftofspeed.com\/gzip-test\/\">Giftofspeed<\/a> or <a href=\"https:\/\/www.whatsmyip.org\/http-compression-test\/\">HTTP compression test<\/a> and scan your site. Both tools check if your web server sends the GZIP HTTP header to your visitors\u2019 browsers.&nbsp;<\/p><p>Simply enter the URL and click on the \u201cTest URL\u201d button to launch the verification. In our example, Brotli is enabled, and 79% of our data is compressed.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"541\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed.png\" alt=\"Checking data compression on my website - Source: Giftofspeed\n\" class=\"wp-image-4589485\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed-288x195.png 288w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed-768x519.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed-89x60.png 89w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-data-compression-on-my-website-Source-Giftofspeed-133x90.png 133w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Checking data compression on my website &#8211; Source: <a href=\"https:\/\/www.giftofspeed.com\/gzip-test\/\">Giftofspeed<\/a><br><\/figcaption><\/figure><h3 class=\"wp-block-heading\" id=\"content-enconding-gzip\">3. Check The \u201ccontent-encoding: gzip\u201d Response Header in Developer Tools<\/h3><p>The third way to check if a website delivers GZIP compressed content is by verifying the content-encoding: gzip HTTP response header from the dev tools.&nbsp;<\/p><p>To verify, open your Dev Tools and head over to the \u201cnetwork\u201d section. Go to the \u201cResponse Headers\u201d section. If you see \u201cGZIP\u201d or \u201cBrotli\u201d in the content-encoding row, your text-based content is compressed.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"381\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools.png\" alt=\"Checking if GZIP or Brotli is activated - Source: Chrome Dev Tools\n\" class=\"wp-image-4589494\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools-310x148.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools-768x366.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools-126x60.png 126w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Checking-if-GZIP-or-Brotli-is-activated-Source-Chrome-Dev-Tools-189x90.png 189w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Checking if GZIP or Brotli is activated &#8211; Source: Chrome Dev Tools<br><\/figcaption><\/figure><h3 class=\"wp-block-heading\" id=\"phpinfo-file\">4. Create a phpinfo File<\/h3><p>If you are comfortable with PHP settings for your site, you might want to create a phpinfo page to activate data compression.&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"489\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger.png\" alt=\"A new phpinfo file was created - Source: Hostinger\n\" class=\"wp-image-4589503\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger-310x189.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger-768x469.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger-98x60.png 98w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/A-new-phpinfo-file-was-created-Source-Hostinger-147x90.png 147w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>A new phpinfo file was created &#8211; Source: <a href=\"https:\/\/www.hostinger.com\/tutorials\/how-to-create-phpinfo-file\">Hostinger<\/a><br><\/figcaption><\/figure><p>To do this, you just need to create a new page for your site. Here\u2019s how to do it via cPanel:<\/p><ol class=\"wp-block-list\"><li>Log in to cPanel of your site and open the file manager (from your hosting provider)<\/li><li>Navigate to the directory you are working with, i.e. the root folder for your site, which should be public_html.<\/li><li>Create a new file and name it phpinfo.php<\/li><li>Open the file and enter the following code:<br><br><code>&lt;?php<\/code><br><code>phpinfo();<\/code><br><code>?&gt;<\/code><br><\/li><li>Save your changes<\/li><li>Open a new tab in your browser. If you created the file in your site\u2019s root folder (i.e. public_html), go to yoursite.com\/phpinfo.php to view your new phpinfo page<\/li><li>Scroll down the page and look out for the <em>mod_gzip<\/em> or <em>mod_deflate <\/em>modules. If they\u2019re listed and enabled, GZIP compression should be available.<\/li><\/ol><h2 class=\"wp-block-heading\">How to Enable Data Compression on WordPress (Manually)<\/h2><p>Enabling text compression on WordPress means activating the GZIP or Brotli algorithm on your text-based data to create smaller files and boost performance.&nbsp;<\/p><p>If you don\u2019t have GZIP compression enabled yet, there are several techniques you can follow, such as asking your host, setting up a CDN, or manually doing it on the web server you\u2019re using to host your site.&nbsp;<\/p><h3 class=\"wp-block-heading\">1. Ask Your Hosting Provider<\/h3><p>One of the most straightforward ways to enable Brotli or GZIP compression on your site is to ensure your host does this by default before choosing it. Siteground, for example, enables GZIP compression on all their websites by default:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"458\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround.png\" alt=\"GZIP compression from Siteground Hosting Provider - Source: SiteGround\n\" class=\"wp-image-4589515\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround-310x177.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround-768x440.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround-105x60.png 105w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-compression-from-Siteground-Hosting-Provider-Source-SiteGround-157x90.png 157w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP compression from Siteground Hosting Provider &#8211; Source: <a href=\"https:\/\/www.siteground.com\/kb\/how_to_enable_gzip_compression_for_your_pages\/\">SiteGround<\/a><br><\/figcaption><\/figure><h3 class=\"wp-block-heading\">2. Set up a CDN<\/h3><p>By using a CDN like <a href=\"https:\/\/rocketcdn.me\/features\/\">RocketCDN<\/a>, you\u2019ll automatically get the GZIP compression activated on all your data. RocketCDN runs on the StackPath network. Therefore GZIP compression is enabled by default on all StackPath CDN sites. The CDN compresses JS, HTML, CSS, and text files automatically.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"388\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository.png\" alt=\"RocketCDN plugin - Source: WordPress repository\n\" class=\"wp-image-4589524\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository-310x150.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository-768x372.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository-124x60.png 124w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/RocketCDN-plugin-Source-WordPress-repository-186x90.png 186w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>RocketCDN plugin &#8211; Source: <a href=\"https:\/\/wordpress.org\/plugins\/rocketcdn\/\">WordPress repository<\/a><br><\/figcaption><\/figure><p>The three following methods depend on which web server you\u2019ve chosen to host your website.<\/p><h3 class=\"wp-block-heading\">3. Enable GZIP Compression on Apache<\/h3><p>To enable GZIP compression on Apache servers, you need to use its \u201cmod_filter\u201d and \u201cmod_deflate modules\u201d and configure them. To guide Apache to compress the data before sending it to the browser, you can use \u201cdirectives\u201d.&nbsp;<\/p><p>There are two options to edit Apache\u2019s server configs based on your access level:<\/p><p>Situation A: you can access the main server configuration file (usually called httpd.conf). Great! You can use it to configure Apache.<\/p><p>Situation B: you can\u2019t access the httpd.conf. In that case, you need to configure Apache using the .htaccess file.<\/p><p>In most cases, you\u2019ll have only access to the .htaccess file, so our tutorial will be&nbsp;<\/p><p>for situation B (activating GZIP through .htaccess file). Make sure you add the code above after any other directives already in your .htaccess file.<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_deflate.c&gt;\n  # Compress HTML, CSS, JavaScript, Text, XML and fonts\n  AddOutputFilterByType DEFLATE application\/javascript\n  AddOutputFilterByType DEFLATE application\/rss+xml\n  AddOutputFilterByType DEFLATE application\/vnd.ms-fontobject\n  AddOutputFilterByType DEFLATE application\/x-font\n  AddOutputFilterByType DEFLATE application\/x-font-opentype\n  AddOutputFilterByType DEFLATE application\/x-font-otf\n  AddOutputFilterByType DEFLATE application\/x-font-truetype\n  AddOutputFilterByType DEFLATE application\/x-font-ttf\n  AddOutputFilterByType DEFLATE application\/x-javascript\n  AddOutputFilterByType DEFLATE application\/xhtml+xml\n  AddOutputFilterByType DEFLATE application\/xml\n  AddOutputFilterByType DEFLATE font\/opentype\n  AddOutputFilterByType DEFLATE font\/otf\n  AddOutputFilterByType DEFLATE font\/ttf\n  AddOutputFilterByType DEFLATE image\/svg+xml\n  AddOutputFilterByType DEFLATE image\/x-icon\n  AddOutputFilterByType DEFLATE text\/css\n  AddOutputFilterByType DEFLATE text\/html\n  AddOutputFilterByType DEFLATE text\/javascript\n  AddOutputFilterByType DEFLATE text\/plain\n  AddOutputFilterByType DEFLATE text\/xml  \n\n  # Remove browser bugs (only needed for ancient browsers)\n  BrowserMatch ^Mozilla\/4 gzip-only-text\/html\n  BrowserMatch ^Mozilla\/4\\.0[678] no-gzip\n  BrowserMatch \\bMSIE !no-gzip !gzip-only-text\/html\n  Header append Vary User-Agent &lt;\/IfModule&gt;\n<\/code><\/pre><h3 class=\"wp-block-heading\">4. Enable Brotli Compression on Apache (brotli_module)<\/h3><p>Follow our steps below to enable Brotli compression on Apache:<\/p><p><strong>Step 1 &#8211; Install Brotli package on your system&nbsp;<\/strong><\/p><p>For Ubuntu and Debian systems, it\u2019s available in the default repositories. Open the terminal and type the following code:<\/p><pre class=\"wp-block-code\"><code class=\"\">$sudo apt install brotli -y <\/code><\/pre><p><strong>Step 2 &#8211; Enable the brotli module<\/strong><\/p><p>The Apache server contains the Brotli module default. You can enable the brotli module in Apache with the following command:&nbsp;<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo a2enmod brotli \n<\/code><\/pre><p><strong>Step 3 &#8211; Configure Apache virtual host to enable compression&nbsp;<\/strong><\/p><p>Simply add the below code in the virtual host configuration file:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_brotli.c&gt;\n    AddOutputFilterByType BROTLI_COMPRESS text\/html text\/plain text\/xml text\/css text\/javascript application\/javascript\n&lt;\/IfModule&gt;\n<\/code><\/pre><p>Important: save the configuration file, close it and reload the Apache service to apply changes.<\/p><p>Save the configuration file and close it. Then reload the Apache service to apply changes:<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo systemctl restart apache2 \n<\/code><\/pre><p>That\u2019s it! Brotli compression should now be enabled in the Apache server.<\/p><h3 class=\"wp-block-heading\">5. Enable GZIP Compression on NGINX<\/h3><p>If your site is hosted on an NGINX server, enabling GZIP compression is fairly easy.&nbsp;<\/p><ul class=\"wp-block-list\"><li>Open up your nginx.conf file. Typically, you can find this file in your server\u2019s \/etc\/nginx\/nginx.conf location.<\/li><li>Add the following directive:<\/li><\/ul><pre class=\"wp-block-code\"><code class=\"\">gzip on;\n<\/code><\/pre><ul class=\"wp-block-list\"><li>Reload Nginx after saving your nginx.conf file with the following terminal command: sudo service nginx reload<\/li><\/ul><p>For more on how to configure compression and decompression on NGINX, check out <a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/web-server\/compression\/?_ga=2.186290785.915531027.1658401743-1682707224.1614598940\">this handy guide<\/a> on the NGINX site. You can also head to the official <a href=\"http:\/\/nginx.org\/en\/docs\/http\/ngx_http_gzip_module.html#gzip_disable\">Nginx documentation <\/a>for a list of all the ngx_http_gzip_module directives.<\/p><h3 class=\"wp-block-heading\">6. Enable Brotli Compression on NGINX (ngx_brotli)<\/h3><p>To enable Brotli Compression on NGINX you\u2019ll need two modules:<\/p><ul class=\"wp-block-list\"><li>ngx_brotli filter module \u2013 for compressing responses on-the-fly<\/li><li>ngx_brotli static module &#8211; for serving pre-compressed files<\/li><\/ul><p><strong>Step 1: Install the nginx-plus-module-brotli module<\/strong><\/p><p><em>For Amazon Linux 2 LTS, CentOS, Oracle Linux, and RHEL:<\/em><\/p><pre class=\"wp-block-code\"><code class=\"\">$ yum install nginx-plus-module-brotli<\/code><\/pre><p><em>For Debian and Ubuntu:<\/em><\/p><pre class=\"wp-block-code\"><code class=\"\">$ apt-get install nginx-plus-module-brotli<\/code><\/pre><p><em>For SLES 15:<\/em><\/p><pre class=\"wp-block-code\"><code class=\"\">$ zypper install nginx-plus-module-brotli<\/code><\/pre><p><strong>Step 2: Configure<\/strong><\/p><p>Now you can configure Brotli modules in the NGINX Plus configuration file nginx.conf.<\/p><ol class=\"wp-block-list\"><li>Enable dynamic loading of Brotli modules with the load_module directives specified in the top-level (\u201cmain\u201d) context:<\/li><\/ol><pre class=\"wp-block-code\"><code class=\"\">load_module modules\/ngx_http_brotli_filter_module.so; # for compressing responses on-the-fly\nload_module modules\/ngx_http_brotli_static_module.so; # for serving pre-compressed files\n \nhttp {\n    #...\n}\n<\/code><\/pre><p>2. Enable Brotli compression and perform additional configuration as required by the <a href=\"https:\/\/github.com\/google\/ngx_brotli\/#configuration-directives\">ngx_brotli<\/a> module. Brotli compression can be configured on the http, server or location levels:<\/p><pre class=\"wp-block-code\"><code class=\"\">http {\n    server {\n        brotli on;\n        #...\n    }\n}\n<\/code><\/pre><p>3. Test the configuration and reload NGINX Plus to enable the module:<\/p><pre class=\"wp-block-code\"><code class=\"\">$ nginx -t &amp;&amp; nginx -s reload<\/code><\/pre><p>And that\u2019s it! You can find <a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/dynamic-modules\/brotli\/\">more detailed steps in NGINX official documentation<\/a>.&nbsp;<\/p><h3 class=\"wp-block-heading\">7. Enable GZIP or Brotli Compression on IIS Web Server<\/h3><p>Note that the IIS Web Server created by Microsoft is not fully compatible with WordPress, so it\u2019s quite rare to find any WordPress site using this technology. However, if you are using this setup, please refer to the <a href=\"https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-server-2008-R2-and-2008\/cc771003(v=ws.10)\">official Microsoft documentation<\/a>.&nbsp;<\/p><h2 class=\"wp-block-heading\">How to Enable Data Compression on WordPress (With a Plugin)<\/h2><p>If you are not too comfortable opening your config files and running some commands, or if you simply want to save time, then you may use a WordPress plugin to enable data compression on your WordPress site.&nbsp;&nbsp;<\/p><p>Most cache and performance WordPress plugins come with the GZIP compression feature. They activate it out of the box or include an option directly in the cache settings panel.&nbsp;<\/p><p>Let\u2019s take the example of <a href=\"https:\/\/wp-rocket.me\/features\/\">WP Rocket<\/a> which also appears to be <a href=\"https:\/\/wp-rocket.me\/best-wordpress-caching-plugin\/\">one of the best caching plugins for WordPress<\/a>.<br><br>If you host your WordPress site on an Apache or Litespeed server, <a href=\"https:\/\/docs.wp-rocket.me\/article\/63-enable-gzip-compression\">WP Rocket automatically lets you add GZIP compression rules<\/a>. It enables GZIP compression by adding mod_deflate module to the <a href=\"https:\/\/kinsta.com\/knowledgebase\/wordpress-htaccess-file\/\">.htaccess file<\/a> right after activating the plugin!<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"322\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard.png\" alt=\"GZIP activated once WP Rocket is activated - Source: WP Rocket\u2019s dashboard\n\" class=\"wp-image-4589556\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard-310x125.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard-768x309.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard-149x60.png 149w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GZIP-activated-once-WP-Rocket-is-activated-Source-WP-Rockets-dashboard-224x90.png 224w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GZIP activated once WP Rocket is activated &#8211; Source: WP Rocket\u2019s dashboard<br><\/figcaption><\/figure><p>Lighthouse also recommends using a plugin like WP Rocket to enable text compression:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"184\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix-.png\" alt=\"GTmetrix recommending WP Rocket to enable text compression - Source: GTmetrix\n\" class=\"wp-image-4589563\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix-.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix--310x71.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix--768x177.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix--190x44.png 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/GTmetrix-recommending-WP-Rocket-to-enable-text-compression-Source-GTmetrix--391x90.png 391w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>GTmetrix recommending WP Rocket to enable text compression &#8211; Source: <a href=\"https:\/\/gtmetrix.com\/reports\/jujuetbeli.fr\/tUNmdR3n\/\">GTmetrix<\/a><br><\/figcaption><\/figure><p>WP Rocket does not only apply GZIP compression. It also helps you improve your Core Web Vitals and overall web performance. It comes with powerful features such as lazy-loading, removing unused CSS, minifying CSS and JS, delaying the non-critical JS, and much more!&nbsp;<\/p><p>Let\u2019s run a simple performance audit on PageSpeed Insights before and after activating WP Rocket on my WordPress site.&nbsp;<\/p><figure class=\"wp-block-table\"><table><tbody><tr><td>Overall performance and Core Web Vitals (no WP Rocket)<\/td><td>\u2705 Overall performance and Core Web Vitals (with WP Rocket) \ud83d\ude80<\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/ahqqU85KInz3KXCgYw9G5-Zx1VkYo_xh-NhJoFIrOBrxcXiN2U39LQSxPsdXixVza0rdrspUFlUFCDT7ib6tWo9Wc0K1O4YFcrCNQaEyadpeL96zT5Ur0lZ-Z-l81PyvEIjxBNRnNRs6bEw3qe2_sec\" width=\"286\" height=\"179\"><\/td><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/mjodNFqOPOs3xsQqUxpf3-Yv8kntEIlyt4vXI3rHzRX_j99-yJwKmrK11ezAtWrE7TnUQ8xxDxVhBaua0EdK4NXqpGlIiksOq6qbKoCu5p7a4rUJgn-eKUTzIinct0Hr2sNB7tMgtcqYxnUCMoBBQfM\" width=\"286\" height=\"169\"><\/td><\/tr><tr><td>Audit section in red (no WP Rocket)<\/td><td>\u2705 Passed audit section in green (with WP Rocket) \ud83d\ude80<\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/P_yHwPdHHXpNFkpJEgZfjSdEM8esnsA1GA3xu4be9KF2ctDd1dkXtDPp5DBRiAvzp4yTu4oZWdAVLk8x31207Rwq_kF9FZSP81DFoNZqU-rNzgNxIRi7YvHRX2-lMJ9-EsC3e6N7d246j1Aik9VHaEU\" width=\"286\" height=\"165\"><\/td><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/5advQtreZ06yZsW2tGsy7PlQP9S0RmdRLJTmIIsVfpP8fnflFDHrX8tk9VaoekD52BbKi_3oKBqLhQRyi1twO_njfhYTRddxn3Rg5w8m_rQZO6a1e2vTwPbyqK-y4M0Sbh6YiidWj5HDYumCND8TQws\" width=\"286\" height=\"103\"><\/td><\/tr><tr><td>Lighthouse warning \u201cEnable Text Compression\u201d (no WP Rocket)<\/td><td>\u2705 Fixed Lighthouse warning \u201cEnable Text Compression\u201d(with WP Rocket)\ud83d\ude80<\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/pMd9s1NTYuPDY2joD33o88N8nOnh6LOih1M2QuD8Bzn41zna6gJVR3RLQZXtctgOXGNZ7ClbRLwXWROw0eIr5hFOX4TEy75jxLOAADvdJv6sV4_wb5nCgRDzgzeAevdppIuI7brsRUCURZW4yXMwXTE\" width=\"286\" height=\"17\"><\/td><td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/TBqmpymDw3wQ45mk0ewn8XgVV0oRPb1hS9P0nPB3Tzy4yZlqcv18mTtS6dVsXVBGgJw6prjDJzqXjfn0ps7AAkxFGjv599yyNeVKodIqjYRlAmPWpPV46neyPv0H8yQrO8X9Oj7qpiAzjvqbFMl6rbs\" width=\"286\" height=\"19\"><\/td><\/tr><\/tbody><\/table><\/figure><h2 class=\"wp-block-heading\">Wrapping Up<\/h2><p>You should now understand why data compression is essential for web speed and the user experience.&nbsp;<\/p><figure class=\"wp-block-table\"><table><tbody><tr><td>\ud83d\udcdd <strong>Data compression in a nutshell:<\/strong> Smaller compressed files \u2192 Less work for the servers \u2192 Less content to parse and download for the browser \u2192 Faster loading time<\/td><\/tr><\/tbody><\/table><\/figure><p>Data compression can be tricky to perform manually, but with a plugin like WP Rocket, the text-based optimization technique becomes very easy! Using WP Rocket and all its optimization features, you\u2019ll enhance the Core Web Vitals grade and the performance score of your WordPress site.&nbsp;<\/p><p>Haven\u2019t tried WP Rocket yet? Save yourself time and let <a href=\"https:\/\/wp-rocket.me\/pricing\/\">WP Rocket <\/a>do the data compression job for you. You don\u2019t even have to touch any settings!&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn everything you should know on text compression.<\/p>\n","protected":false},"template":"","core_web_vitals":[132],"class_list":["post-4589134","core_web_vitals_hub","type-core_web_vitals_hub","status-publish","hentry","core_web_vitals-improve-largest-contentful-paint"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site<\/title>\n<meta name=\"description\" content=\"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site\" \/>\n<meta property=\"og:description\" content=\"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-20T10:23:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\",\"url\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\",\"name\":\"How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png\",\"datePublished\":\"2022-07-26T05:42:03+00:00\",\"dateModified\":\"2022-09-20T10:23:52+00:00\",\"description\":\"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png\",\"width\":800,\"height\":347},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Core Web Vitals\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Largest Contentful Paint\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Enable Text Compression to Speed up Your Site\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site","description":"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site","og_description":"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!","og_url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_modified_time":"2022-09-20T10:23:52+00:00","og_image":[{"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png"}],"twitter_card":"summary_large_image","twitter_site":"@wp_rocket","twitter_misc":{"Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/","url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/","name":"How to Enable Text Compression (GZIP and Brotli) to Speed up Your Site","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png","datePublished":"2022-07-26T05:42:03+00:00","dateModified":"2022-09-20T10:23:52+00:00","description":"Enabling text compression on WordPress allows you to keep your website loading fast and addresses a specific PageSpeed Insights audit. Read the article and learn more!","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2022\/07\/Opportunities-section-Lighthouse-report-listing-all-textbased-resources-that-arent-compressed-Source-PageSpeed-Insights-.png","width":800,"height":347},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Core Web Vitals","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/"},{"@type":"ListItem","position":3,"name":"Largest Contentful Paint","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/"},{"@type":"ListItem","position":4,"name":"How to Enable Text Compression to Speed up Your Site"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub\/4589134"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/core_web_vitals_hub"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=4589134"}],"wp:term":[{"taxonomy":"core_web_vitals","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals?post=4589134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}