{"id":405,"date":"2010-09-13T09:20:41","date_gmt":"2010-09-13T16:20:41","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=405"},"modified":"2010-09-13T09:21:42","modified_gmt":"2010-09-13T16:21:42","slug":"405","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=405","title":{"rendered":"How to enable compression in an apache web server."},"content":{"rendered":"<p>This worked great for me for all of my websites.  I did this globally by adding the following in my \/etc\/http\/conf\/httpd.conf file.  I had no other Location options enabled.  I could do this by VirtualHost, buy opted not to for now, since I have very little upload bandwidth. <\/p>\n<p>I took this, as is, from http:\/\/httpd.apache.org\/docs\/2.0\/mod\/mod_deflate.html.  <\/p>\n<p><Location \/><br \/>\n# Insert filter<br \/>\nSetOutputFilter DEFLATE<\/p>\n<p># Netscape 4.x has some problems&#8230;<br \/>\nBrowserMatch ^Mozilla\/4 gzip-only-text\/html<\/p>\n<p># Netscape 4.06-4.08 have some more problems<br \/>\nBrowserMatch ^Mozilla\/4\\.0[678] no-gzip<\/p>\n<p># MSIE masquerades as Netscape, but it is fine<br \/>\n# BrowserMatch \\bMSIE !no-gzip !gzip-only-text\/html<\/p>\n<p># NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48<br \/>\n# the above regex won&#8217;t work. You can use the following<br \/>\n# workaround to get the desired effect:<br \/>\nBrowserMatch \\bMSI[E] !no-gzip !gzip-only-text\/html<\/p>\n<p># Don&#8217;t compress images<br \/>\nSetEnvIfNoCase Request_URI \\<br \/>\n\\.(?:gif|jpe?g|png)$ no-gzip dont-vary<\/p>\n<p># Make sure proxies don&#8217;t deliver the wrong content<br \/>\nHeader append Vary User-Agent env=!dont-vary<br \/>\n<\/Location> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This worked great for me for all of my websites. I did this globally by adding the following in my \/etc\/http\/conf\/httpd.conf file. I had no other Location options enabled. I could do this by VirtualHost, buy opted not to for now, since I have very little upload bandwidth. I took this, as is, from http:\/\/httpd.apache.org\/docs\/2.0\/mod\/mod_deflate.html. [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[120,122,121],"class_list":["post-405","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-apache","tag-compression","tag-httpd"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=405"}],"version-history":[{"count":2,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/405\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/405\/revisions\/407"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}