{"id":32809,"date":"2021-12-20T15:00:16","date_gmt":"2021-12-20T14:00:16","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=32809"},"modified":"2021-12-20T12:29:56","modified_gmt":"2021-12-20T11:29:56","slug":"how-to-enable-gzip-compression-in-wordpress","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/how-to-enable-gzip-compression-in-wordpress\/","title":{"rendered":"How to Enable GZIP Compression in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]There is a myriad of factors which can affect user experience. The major one is likely content, but even top-notch content may not be enough if your website scores poorly in terms of user experience. Don\u2019t worry, though: a lot of things can be done in terms of improving user experience. Some of them, like ease of navigation, are a little abstract (if they work well, nobody will notice them), and some, such as <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-improve-accessibility-wordpress\/\">website accessibility<\/a>, may even involve redesigning some of your website\u2019s features. Website speed is one of the former.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we will be discussing a way to improve your website speed: GZIP, and show you how to implement it in WordPress. But what is GZIP compression? How does it work? Does your website really need it? We will be answering all of these questions in the article below. Here are the topics we will be touching upon in our exploration of GZIP and WordPress:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#what-is-gzip-compression\">What Is GZIP Compression<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#why-use-gzip-compression\">Why Use GZIP Compression<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-check-whether-gzip-compression-is-already-enabled\">How to Check Whether GZIP Compression Is Already Enabled<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-enable-gzip-compression-using-plugin\">How to Enable GZIP Compression Using a Plugin<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-enable-gzip-compression-on-apache-servers\">How to Enable GZIP Compression On Apache Servers<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-enable-gzip-compression-on-nginx-servers\">How to Enable GZIP Compression On Nginx Servers<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"what-is-gzip-compression\"><\/a>What Is GZIP Compression<\/h2>\n<p>[\/vc_column_text][vc_column_text]The clue is in the name: it is <strong>a way of compressing data<\/strong> \u2013 in this case, website data \u2013 <strong>making it smaller and therefore faster to load<\/strong>. But that doesn\u2019t answer the main thrust of the question.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Data compression itself is well beyond the scope of this article, but for the purposes of addressing GZIP in particular, we will say that preferred <strong>methods of compression largely depend on the type of data you want compressed<\/strong>. You wouldn\u2019t use the same methods to <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-optimize-images-for-web\/\">optimize images<\/a> and <a href=\"https:\/\/qodeinteractive.com\/magazine\/minify-css-javascript-files-in-wordpress\/\">minify CSS and JavaScript<\/a>, for instance, but the purpose is the same.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]GZIP is short for <strong>GNU Zip<\/strong>, and is currently the most popular lossless compression algorithm. It works advanced mathematical magic and can compress any file type, but works best with HTML, CSS, JavaScript, and other text-based files.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Apart from being an algorithm, it is also a piece of software used for compression and decompression, and a file format. The file resulting from GZIP compression typically has .gz for its suffix.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]As for how it works, we can\u2019t go very deep into that without getting too technical. We will say that it uses an algorithm called LZ77 to detect redundancies (repeated places in the text) and replace them with ordered sequences of elements known as tuples in mathematics. It then uses another algorithm known as Huffman coding to compress the result even more, reencoding more frequent characters with fewer bits than those less frequent.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]This combination of LZ77 and Huffman coding creates the<em> .gz<\/em> file mentioned above. The resulting file may be reduced down to 10% of the original\u2019s size, though this varies.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"why-use-gzip-compression\"><\/a>Why Use GZIP Compression<\/h2>\n<p>[\/vc_column_text][vc_column_text]If you are not convinced by the possibility of reducing your file sizes (and, consequently, loading speeds), let us discuss some additional benefits of GZIP.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]First, you should take note that, in order to display the website to a user, the browser has to decompress the .gz file in order to execute it. And, while GZIP may not be the most efficient method of storing data, its combined algorithms are so refined as to be by far the<strong> fastest yet developed<\/strong>, both ways: <strong>compressing and decompressing<\/strong>. So, while there may be more efficient ways of making your files smaller, you could still lose out on the loading speed.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Secondly, it is<strong> free and open source<\/strong>. This means that it does not require a paid license agreement to use. It was originally developed as a free alternative to paid solutions, which is part of the reason why it is so widespread.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Thirdly, it is <strong>resistant to entropy encryption<\/strong>. If a file is already efficiently organized or very small, applying a compression algorithm to it can result in increasing the size of the file, rather than the other way around, as the encryption dictionary gets added to it. With GZIP, this rarely happens, and the effects are not as adverse as with some other compression algorithms.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Finally, the compression itself: while there are more efficient algorithms in terms of<strong> file size reduction<\/strong>, GZIP is still very efficient in that respect, being <strong>capable of reducing textual file sizes by 70 to 90%<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]It is therefore no surprise that GZIP sees widespread usage in various fields, from image compression (such as in <em>.png<\/em>) through console gaming, where every bit and hertz count, all the way to some of the most popular operating systems. In terms of application to websites, GZIP can <strong>improve your website\u2019s loading speed significantly<\/strong>, resulting in <strong>positive effects on your SERP ranking and user experience.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-check-whether-gzip-compression-is-already-enabled\"><\/a>How to Check Whether GZIP Compression Is Already Enabled<\/h2>\n<p>[\/vc_column_text][vc_column_text]Since GZIP is so widely used and supported, many hosting providers enable it by default. Still, it may happen that GZIP compression is not used on your server.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To check that, you can use any number of online tools. For this demonstration, we have opted for <a href=\"https:\/\/sitechecker.pro\/gzip-test\/\" target=\"_blank\" rel=\"noopener\">Sitechecker Pro\u2019s GZIP checker<\/a>. Simply follow the link, enter the URL for which you wish to check GZIP compression, and click the arrow icon. We have gone with Qode Magazine\u2019s URL.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Sitechecker-Pros-GZIP-checker.jpg\" class=\"attachment-full size-full\" alt=\"Sitechecker Pro\u2019s GZIP checker\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Sitechecker-Pros-GZIP-checker.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Sitechecker-Pros-GZIP-checker-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Sitechecker-Pros-GZIP-checker-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Sitechecker-Pros-GZIP-checker-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]As you can see, GZIP compression is enabled. Sitechecker will also inform you of how efficient the compression was. In our case, it is over 90%.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Test.jpg\" class=\"attachment-full size-full\" alt=\"GZIP Compression Test\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Test.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Test-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Test-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Test-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Most website speed checking tools, such as <a href=\"https:\/\/pagespeed.web.dev\/\" target=\"_blank\" rel=\"noopener\">PageSpeed Insights<\/a>, will serve you with an alert message in case GZIP compression is not enabled.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Finally, you could use your browser\u2019s inspect tool to check whether GZIP coding is enabled. We will be testing our own website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Activate the inspect tool by right-clicking anywhere (the background, in our case), and selecting <strong>Inspect<\/strong> to open the console.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Page.jpg\" class=\"attachment-full size-full\" alt=\"Inspect Page\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Page.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Page-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Page-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Page-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Once there, find the <strong>Network<\/strong> tab and click it.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Network.jpg\" class=\"attachment-full size-full\" alt=\"Inspect Network\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Network.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Network-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Network-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Inspect-Network-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Finally, locate the HTML document and check its <strong>Headers<\/strong> section for the <strong>content-encoding: gzip<\/strong> and <strong>accept-encoding: gzip<\/strong> headers.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"508\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Network-Headers.jpg\" class=\"attachment-full size-full\" alt=\"Network Headers\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Network-Headers.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Network-Headers-300x157.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Network-Headers-768x403.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/Network-Headers-620x325.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;78px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-enable-gzip-compression-using-plugin\"><\/a>How to Enable GZIP Compression Using a Plugin<\/h2>\n<p>[\/vc_column_text][vc_column_text]As is most often the case, a needed functionality can be provided using a WordPress plugin. For this demonstration, we have selected the free <a href=\"https:\/\/wordpress.org\/plugins\/wp-optimize\/\" target=\"_blank\" rel=\"noopener\">WP-Optimize<\/a> plugin. After <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-install-a-wordpress-plugin\/\">installing and activating the plugin<\/a>, navigate to <strong>WP-Optimize\/Cache<\/strong> from your WordPress dashboard.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/WP-Optimize-Cache.jpg\" class=\"attachment-full size-full\" alt=\"WP Optimize Cache\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/WP-Optimize-Cache.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/WP-Optimize-Cache-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/WP-Optimize-Cache-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/WP-Optimize-Cache-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Once there, select the <strong>Gzip compression<\/strong> tab and click the <strong>Enable<\/strong> button.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enable.jpg\" class=\"attachment-full size-full\" alt=\"GZIP Compression Enable\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enable.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enable-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enable-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enable-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]And, just like that, you have enabled GZIP compression on your website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enabled.jpg\" class=\"attachment-full size-full\" alt=\"GZIP Compression Enabled\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enabled.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enabled-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enabled-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/12\/GZIP-Compression-Enabled-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;78px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-enable-gzip-compression-on-apache-servers\"><\/a>How to Enable GZIP Compression On Apache Servers<\/h2>\n<p>[\/vc_column_text][vc_column_text]If you are using an Apache server (currently the commonest), you can <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-use-ftp\/\">use FTP<\/a> to <strong>edit your configuration files in order to enable GZIP<\/strong> compression on your website. Note that while WordPress is very user-friendly, we cannot recommend code editing for beginner users.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Simply <a href=\"https:\/\/qodeinteractive.com\/magazine\/find-htaccess-file-on-wordpress-site\/\">find the<em> .htaccess<\/em><\/a> file in your root WordPress directory and add the following code after the existing directives:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;IfModule mod_deflate.c&gt;\r\n# Compress HTML, CSS, JS, text, XML and font files\r\nAddOutputFilterByType DEFLATE application\/javascript\r\nAddOutputFilterByType DEFLATE application\/rss+xml\r\nAddOutputFilterByType DEFLATE application\/vnd.ms-fontobject\r\nAddOutputFilterByType DEFLATE application\/x-font\r\nAddOutputFilterByType DEFLATE application\/x-font-opentype\r\nAddOutputFilterByType DEFLATE application\/x-font-otf\r\nAddOutputFilterByType DEFLATE application\/x-font-truetype\r\nAddOutputFilterByType DEFLATE application\/x-font-ttf\r\nAddOutputFilterByType DEFLATE application\/x-javascript\r\nAddOutputFilterByType DEFLATE application\/xhtml+xml\r\nAddOutputFilterByType DEFLATE application\/xml\r\nAddOutputFilterByType DEFLATE font\/opentype\r\nAddOutputFilterByType DEFLATE font\/otf\r\nAddOutputFilterByType DEFLATE font\/ttf\r\nAddOutputFilterByType DEFLATE image\/svg+xml\r\nAddOutputFilterByType DEFLATE image\/x-icon\r\nAddOutputFilterByType DEFLATE text\/css\r\nAddOutputFilterByType DEFLATE text\/html\r\nAddOutputFilterByType DEFLATE text\/javascript\r\nAddOutputFilterByType DEFLATE text\/plain\r\nAddOutputFilterByType DEFLATE text\/xml\r\n# Fix browser bugs on old browsers\r\nBrowserMatch ^Mozilla\/4 gzip-only-text\/html\r\nBrowserMatch ^Mozilla\/4\\.0[678] no-gzip\r\nBrowserMatch \\bMSIE !no-gzip !gzip-only-text\/html\r\nHeader append Vary User-Agent\r\n&lt;\/IfModule&gt;<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Note that the above code will only be executed if the <em>mod_filter<\/em> module is active on your server. Contact your hosting provider for details on that.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Sometimes, other software (proxies, firewalls, and other security software) may interfere with GZIP compression by disallowing<em> accept-encoding<\/em> headers. To ensure this doesn\u2018t happen, use the following code instead of the one given above:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\"application\/wasm\" \\\r\n\"application\/x-font-ttf\" \\\r\n\"application\/x-javascript\" \\\r\n\"application\/x-web-app-manifest+json\" \\\r\n\"application\/xhtml+xml\" \\\r\n\"application\/xml\" \\\r\n\"font\/eot\" \\\r\n\"font\/opentype\" \\\r\n\"font\/otf\" \\\r\n\"font\/ttf\" \\\r\n\"image\/bmp\" \\\r\n\"image\/svg+xml\" \\\r\n\"image\/vnd.microsoft.icon\" \\\r\n\"text\/cache-manifest\" \\\r\n\"text\/calendar\" \\\r\n\"text\/css\" \\\r\n\"text\/html\" \\\r\n\"text\/javascript\" \\\r\n\"text\/plain\" \\\r\n\"text\/markdown\" \\\r\n\"text\/vcard\" \\\r\n\"text\/vnd.rim.location.xloc\" \\\r\n\"text\/vtt\" \\\r\n\"text\/x-component\" \\\r\n\"text\/x-cross-domain-policy\" \\\r\n\"text\/xml\"\r\n&lt;\/IfModule&gt;\r\n&lt;IfModule mod_mime.c&gt;\r\nAddType image\/svg+xml svg svgz\r\nAddEncoding gzip svgz\r\n&lt;\/IfModule&gt;\r\n&lt;\/IfModule&gt;<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-enable-gzip-compression-on-nginx-servers\"><\/a>How to Enable GZIP Compression On Nginx Servers<\/h2>\n<p>[\/vc_column_text][vc_column_text]In case you are using an Nginx server (the second most popular server), you need to edit the <em>nginx.conf<\/em> file, typically found at <em>etc\/nginx\/nginx.conf<\/em> on your server.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You need to add the following instructions to it:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Enables GZIP\r\ngzip on;\r\n# Compression level (set within range of 1 to9)\r\ngzip_comp_level 9;\r\n# Minimum file size to compress\r\ngzip_min_length 256;\r\n# Compress data for clients using proxies\r\ngzip_proxied any;\r\n# Proxies to cache regular and GZIP versions of files\r\ngzip_vary on;\r\n# Disables GZIP compression for browsers which don't support it\r\ngzip_disable \"msie6\";\r\n# Compress files with following extensions or MIME-types\r\ngzip_types\r\napplication\/atom+xml\r\napplication\/geo+json\r\napplication\/javascript\r\napplication\/x-javascript\r\napplication\/json\r\napplication\/ld+json\r\napplication\/manifest+json\r\napplication\/rdf+xml\r\napplication\/rss+xml\r\napplication\/vnd.ms-fontobject\r\napplication\/wasm\r\napplication\/x-web-app-manifest+json\r\napplication\/xhtml+xml\r\napplication\/xml\r\nfont\/eot\r\nfont\/otf\r\nfont\/ttf\r\nimage\/bmp\r\nimage\/svg+xml\r\ntext\/cache-manifest\r\ntext\/calendar\r\ntext\/css\r\ntext\/javascript\r\ntext\/markdown\r\ntext\/plain\r\ntext\/xml\r\ntext\/vcard\r\ntext\/vnd.rim.location.xloc\r\ntext\/vtt\r\ntext\/x-component\r\ntext\/x-cross-domain-policy;<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Once you have done that, you will need to reload Nginx before the instructions are executed using the following command:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo service nginx reload<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">In Conclusion<\/h2>\n<p>[\/vc_column_text][vc_column_text]If there is a quick way of improving your website\u2018s user experience, there is no reason not to try it. If there is a quick way of making your website rank better in searches, there is no reason not to try it. If there is a quick way of ensuring speedier loading and smoother running of your website, there is no reason not to try it. GZIP compression is all three.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Use GZIP on your WordPress website to speed it up and improve SERP rankings and UX. We will show you how.<\/p>\n","protected":false},"author":16990,"featured_media":32829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[183,184,4,13],"class_list":["post-32809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-gzip","tag-page-speed","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/32809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/16990"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=32809"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/32809\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/32829"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=32809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=32809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=32809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}