{"id":170,"date":"2004-10-09T09:51:18","date_gmt":"2004-10-09T08:51:18","guid":{"rendered":"http:\/\/wp.devco.net\/?p=170"},"modified":"2009-10-09T17:13:34","modified_gmt":"2009-10-09T16:13:34","slug":"mod_gzip","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2004\/10\/09\/mod_gzip.php","title":{"rendered":"mod_gzip"},"content":{"rendered":"

As I mentioned the other day I want to start fiddling with mod_gzip<\/a>, I did just that and am quite pleased with the result.<\/p>\n

More details on the full entry.<\/p>\n

<\/p>\n

Installing mod_gzip on my FreeBSD machine was as expected trivial with the ports system. Configuring it can be quite a mission, it has a zillion directives and some does not seem to always work the way you would think. A reference for the config can be found here<\/a>.<\/p>\n

The main issue I ran into is that while I tell the config I want all content of a specific content type compressed, it just does not do it for all types of files, I could not convince it to compress output from my php files by mime type so resorted to enabling it by file extension for .php files.<\/p>\n

My config snippet in my virtual server directive for this site is below:<\/p>\n

\n
\n<IfModule mod_gzip.c>\nmod_gzip_on Yes\nmod_gzip_can_negotiate Yes\nmod_gzip_keep_workfiles No\nmod_gzip_minimum_file_size 500\nmod_gzip_maximum_file_size 500000\nmod_gzip_maximum_inmem_size 60000\nmod_gzip_min_http 1000\nmod_gzip_handle_methods GET\nmod_gzip_dechunk Yes\nmod_gzip_add_header_count Yes\nmod_gzip_send_vary On\n# compress these\nmod_gzip_item_include         mime       ^text\/html$\nmod_gzip_item_include         mime       ^text\/plain$\nmod_gzip_item_include         mime       ^text\/css$\nmod_gzip_item_include         mime       ^application\/x-javascript$\nmod_gzip_item_include         mime       ^application\/xml$\nmod_gzip_item_include         file       \\.php$\n# dont compress these\nmod_gzip_item_exclude         file       \\.jpg$\nmod_gzip_item_exclude         file       \\.gif$\nmod_gzip_item_exclude         file       \\.png$\nmod_gzip_item_exclude         reqheader  \"User-agent: \\\nMozilla\/4.0[678]\"\nLogFormat  \"%h %l %u %t \\\"%V %r\\\" %<s %b mod_gzip:\\\n%{mod_gzip_result}n In:%{mod_gzip_input_size}n -< \\\nOut:%{mod_gzip_output_size}n = \\\n%{mod_gzip_compression_ratio}n pct.\" \\\ncommon_with_mod_gzip_info2\nCustomLog \/usr\/local\/www\/www.devco.net\/log\/mod_gzip.log \\\ncommon_with_mod_gzip_info2\n<\/IfModule>\n<\/pre>\n<\/blockquote>\n

After a day or so I can see from my log very impressive results. My .php file output compresses around 75%, my XML files for RSS feeds about 80% and I was quite surprised to see quite a few aggregators support gzip compression and even some of the crawlers out there.<\/p>\n

For now I am quite happy with this addition.<\/p>\n","protected":false},"excerpt":{"rendered":"

As I mentioned the other day I want to start fiddling with mod_gzip, I did just that and am quite pleased with the result. More details on the full entry.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[5],"tags":[19,33],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/170"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":1,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":750,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/170\/revisions\/750"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}