{"id":819,"date":"2020-06-14T11:08:34","date_gmt":"2020-06-14T18:08:34","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=819"},"modified":"2020-06-14T13:56:08","modified_gmt":"2020-06-14T20:56:08","slug":"how-to-enable-gzip-compression-in-apache","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=819","title":{"rendered":"HOW TO ENABLE GZIP COMPRESSION IN APACHE"},"content":{"rendered":"\n<p>by: <a href=\"https:\/\/knackforge.com\/blog\/karalmax\">Karal Max<\/a>&nbsp;<\/p>\n\n\n\n<p>The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">ENABLE GZIP MODULE IN APACHE<\/h4>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp;By default, a mod_deflate module&nbsp;is enabled in Apache. To make sure that it is enabled,&nbsp;check following line in Apache configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LoadModule deflate_module modules\/mod_deflate.so<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">CONFIGURE GZIP COMPRESSION<\/h4>\n\n\n\n<p>&nbsp; &nbsp; &nbsp;&nbsp;Now edit your apache configuration and add the extensions you want to compress.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n\n\n\n<p>Add the following lines at end of the file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AddOutputFilterByType DEFLATE text\/plain\nAddOutputFilterByType DEFLATE text\/html\nAddOutputFilterByType DEFLATE text\/xml\nAddOutputFilterByType DEFLATE text\/css\nAddOutputFilterByType DEFLATE application\/xml\nAddOutputFilterByType DEFLATE application\/xhtml+xml\nAddOutputFilterByType DEFLATE application\/rss+xml\nAddOutputFilterByType DEFLATE application\/javascript\nAddOutputFilterByType DEFLATE application\/x-javascript<\/code><\/pre>\n\n\n\n<p>Restart Apache service,<\/p>\n\n\n\n<p>## CentOS ##<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service httpd restart<\/code><\/pre>\n\n\n\n<p>## Ubuntu ##<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/etc\/init.d\/apache2 restart<\/code><\/pre>\n\n\n\n<p>Add the following configuration in Apache Virtual Host to enable gzip compression for your website. You can also add this code in website&#8217;s .htaccess file in the site root.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Directory \/var\/www\/html\/>\n   &lt;IfModule mod_mime.c>\n\tAddType application\/x-javascript .js\n\tAddType text\/css .css\n   &lt;\/IfModule>\n   &lt;IfModule mod_deflate.c>\n\tAddOutputFilterByType DEFLATE text\/css application\/x-javascript text\/x-component text\/html text\/plain text\/xml application\/javascript\n\t&lt;IfModule mod_setenvif.c>\n\t\tBrowserMatch ^Mozilla\/4 gzip-only-text\/html\n\t\tBrowserMatch ^Mozilla\/4.0&#91;678] no-gzip\n\t\tBrowserMatch bMSIE !no-gzip !gzip-only-text\/html\n\t&lt;\/IfModule>\n    &lt;\/IfModule>\n    Header append Vary User-Agent env=!dont-vary\n&lt;\/Directory>\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">TESTING COMPRESSION<\/h5>\n\n\n\n<p>We have enabled gzip compression, let\u2019s use one of below online tools to verify gzip is working correctly.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.giftofspeed.com\/gzip-test\/\">https:\/\/www.giftofspeed.com\/gzip-test\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.whatsmyip.org\/http-compression-test\/\">https:\/\/www.whatsmyip.org\/http-compression-test\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>by: Karal Max&nbsp; The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache. ENABLE GZIP MODULE IN APACHE &nbsp; &nbsp; &nbsp; &nbsp;By default, <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=819\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[104,5],"tags":[127,126],"class_list":["post-819","post","type-post","status-publish","format-standard","hentry","category-apache","category-linux","tag-apache","tag-gzip"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"by: Karal Max The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache. ENABLE GZIP MODULE IN APACHE By default,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Summa Lai\"\/>\n\t<meta name=\"keywords\" content=\"apache,gzip,linux family\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/SUMMALAI.COM\/?p=819\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#article\",\"name\":\"HOW TO ENABLE GZIP COMPRESSION IN APACHE | Summa Lai\",\"headline\":\"HOW TO ENABLE GZIP COMPRESSION IN APACHE\",\"author\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?author=2#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#articleImage\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Summa_Logo-150x150.png\",\"width\":96,\"height\":96,\"caption\":\"Summa Lai\"},\"datePublished\":\"2020-06-14T11:08:34-07:00\",\"dateModified\":\"2020-06-14T13:56:08-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#webpage\"},\"articleSection\":\"Apache, Linux Family, APACHE, GZIP\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/SUMMALAI.COM\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=5#listItem\",\"name\":\"Linux Family\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=5#listItem\",\"position\":2,\"name\":\"Linux Family\",\"item\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=5\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=104#listItem\",\"name\":\"Apache\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=104#listItem\",\"position\":3,\"name\":\"Apache\",\"item\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=104\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#listItem\",\"name\":\"HOW TO ENABLE GZIP COMPRESSION IN APACHE\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=5#listItem\",\"name\":\"Linux Family\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#listItem\",\"position\":4,\"name\":\"HOW TO ENABLE GZIP COMPRESSION IN APACHE\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?cat=104#listItem\",\"name\":\"Apache\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/#person\",\"name\":\"sladmin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#personImage\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Summa_Logo-150x150.png\",\"width\":96,\"height\":96,\"caption\":\"sladmin\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?author=2#author\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/?author=2\",\"name\":\"Summa Lai\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#authorImage\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Summa_Logo-150x150.png\",\"width\":96,\"height\":96,\"caption\":\"Summa Lai\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#webpage\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819\",\"name\":\"HOW TO ENABLE GZIP COMPRESSION IN APACHE | Summa Lai\",\"description\":\"by: Karal Max The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache. ENABLE GZIP MODULE IN APACHE By default,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?p=819#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?author=2#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/?author=2#author\"},\"datePublished\":\"2020-06-14T11:08:34-07:00\",\"dateModified\":\"2020-06-14T13:56:08-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/#website\",\"url\":\"https:\\\/\\\/SUMMALAI.COM\\\/\",\"name\":\"Summa Lai\",\"description\":\"Never Stop Learning, Building a Little Wiki...\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/SUMMALAI.COM\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"HOW TO ENABLE GZIP COMPRESSION IN APACHE | Summa Lai","description":"by: Karal Max The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache. ENABLE GZIP MODULE IN APACHE By default,","canonical_url":"https:\/\/SUMMALAI.COM\/?p=819","robots":"max-image-preview:large","keywords":"apache,gzip,linux family","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/SUMMALAI.COM\/?p=819#article","name":"HOW TO ENABLE GZIP COMPRESSION IN APACHE | Summa Lai","headline":"HOW TO ENABLE GZIP COMPRESSION IN APACHE","author":{"@id":"https:\/\/SUMMALAI.COM\/?author=2#author"},"publisher":{"@id":"https:\/\/SUMMALAI.COM\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/SUMMALAI.COM\/?p=819#articleImage","url":"https:\/\/SUMMALAI.COM\/wp-content\/uploads\/2020\/05\/Summa_Logo-150x150.png","width":96,"height":96,"caption":"Summa Lai"},"datePublished":"2020-06-14T11:08:34-07:00","dateModified":"2020-06-14T13:56:08-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/SUMMALAI.COM\/?p=819#webpage"},"isPartOf":{"@id":"https:\/\/SUMMALAI.COM\/?p=819#webpage"},"articleSection":"Apache, Linux Family, APACHE, GZIP"},{"@type":"BreadcrumbList","@id":"https:\/\/SUMMALAI.COM\/?p=819#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM#listItem","position":1,"name":"Home","item":"https:\/\/SUMMALAI.COM","nextItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=5#listItem","name":"Linux Family"}},{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=5#listItem","position":2,"name":"Linux Family","item":"https:\/\/SUMMALAI.COM\/?cat=5","nextItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=104#listItem","name":"Apache"},"previousItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=104#listItem","position":3,"name":"Apache","item":"https:\/\/SUMMALAI.COM\/?cat=104","nextItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?p=819#listItem","name":"HOW TO ENABLE GZIP COMPRESSION IN APACHE"},"previousItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=5#listItem","name":"Linux Family"}},{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?p=819#listItem","position":4,"name":"HOW TO ENABLE GZIP COMPRESSION IN APACHE","previousItem":{"@type":"ListItem","@id":"https:\/\/SUMMALAI.COM\/?cat=104#listItem","name":"Apache"}}]},{"@type":"Person","@id":"https:\/\/SUMMALAI.COM\/#person","name":"sladmin","image":{"@type":"ImageObject","@id":"https:\/\/SUMMALAI.COM\/?p=819#personImage","url":"https:\/\/SUMMALAI.COM\/wp-content\/uploads\/2020\/05\/Summa_Logo-150x150.png","width":96,"height":96,"caption":"sladmin"}},{"@type":"Person","@id":"https:\/\/SUMMALAI.COM\/?author=2#author","url":"https:\/\/SUMMALAI.COM\/?author=2","name":"Summa Lai","image":{"@type":"ImageObject","@id":"https:\/\/SUMMALAI.COM\/?p=819#authorImage","url":"https:\/\/SUMMALAI.COM\/wp-content\/uploads\/2020\/05\/Summa_Logo-150x150.png","width":96,"height":96,"caption":"Summa Lai"}},{"@type":"WebPage","@id":"https:\/\/SUMMALAI.COM\/?p=819#webpage","url":"https:\/\/SUMMALAI.COM\/?p=819","name":"HOW TO ENABLE GZIP COMPRESSION IN APACHE | Summa Lai","description":"by: Karal Max The mod_deflate module provides the DEFLATE output filter that allows the output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with an older version of Apache. ENABLE GZIP MODULE IN APACHE By default,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/SUMMALAI.COM\/#website"},"breadcrumb":{"@id":"https:\/\/SUMMALAI.COM\/?p=819#breadcrumblist"},"author":{"@id":"https:\/\/SUMMALAI.COM\/?author=2#author"},"creator":{"@id":"https:\/\/SUMMALAI.COM\/?author=2#author"},"datePublished":"2020-06-14T11:08:34-07:00","dateModified":"2020-06-14T13:56:08-07:00"},{"@type":"WebSite","@id":"https:\/\/SUMMALAI.COM\/#website","url":"https:\/\/SUMMALAI.COM\/","name":"Summa Lai","description":"Never Stop Learning, Building a Little Wiki...","inLanguage":"en-US","publisher":{"@id":"https:\/\/SUMMALAI.COM\/#person"}}]}},"aioseo_meta_data":{"post_id":"819","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-20 22:14:40","updated":"2024-01-12 04:33:26","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/SUMMALAI.COM\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/SUMMALAI.COM\/?cat=5\" title=\"Linux Family\">Linux Family<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/SUMMALAI.COM\/?cat=104\" title=\"Apache\">Apache<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHOW TO ENABLE GZIP COMPRESSION IN APACHE\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/SUMMALAI.COM"},{"label":"Linux Family","link":"https:\/\/SUMMALAI.COM\/?cat=5"},{"label":"Apache","link":"https:\/\/SUMMALAI.COM\/?cat=104"},{"label":"HOW TO ENABLE GZIP COMPRESSION IN APACHE","link":"https:\/\/SUMMALAI.COM\/?p=819"}],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=819"}],"version-history":[{"count":0,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/819\/revisions"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}