{"id":733,"date":"2008-05-08T23:36:08","date_gmt":"2008-05-09T03:36:08","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/2008\/05\/08\/web-compression\/"},"modified":"2008-05-08T23:36:08","modified_gmt":"2008-05-09T03:36:08","slug":"web-compression","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/05\/08\/web-compression\/","title":{"rendered":"Web Compression"},"content":{"rendered":"<p>I&#8217;ve <a href=\"http:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/27\/web-design\/\">alluded<\/a> before to using gzip compression on webserver. HTML is very compressible, so servers moving tremendous amounts of text\/HTML would see a major reduction in bandwidth. (Images and such would <i>not<\/i> see much of a benefit, as they&#8217;re already compressed.)<\/p>\n<p>As an example, I downloaded the main page of Wikipedia, retrieving only the HTML and none of the supporting elements (graphics, stylesheets, external JavaScript). It&#8217;s 53,190 bytes. (This, frankly, isn&#8217;t a lot.) After running it through &#8220;gzip -9&#8221; (strongest compression), it&#8217;s 13,512 bytes, just shy of a 75% reduction in size.<\/p>\n<p>There are a few problems with gzip, though:<\/p>\n<ul>\n <li>Not all clients support it. Although frankly, I think most do. This isn&#8217;t a huge deal, though, as the client and server &#8220;negotiate&#8221; the content encoding, so it&#8217;ll only be used if it&#8217;s supported.<\/li>\n <li>Not all servers support it. I don&#8217;t believe IIS supports it at all, although I could be wrong. Apache\/PHP will merrily do it, but it has to be enabled, which means that lazy server admins won&#8217;t turn it on.<\/li>\n <li>Although it really shouldn&#8217;t work that way, it looks to me as if it will &#8216;buffer&#8217; the whole page then compress it, then send it. (gzip <i>does<\/i> support &#8216;streaming&#8217; compression, just working in blocks.) Thus if you have a page that&#8217;s slow to load (e.g., it runs complex database queries that can&#8217;t be cached), it will appear even worse: users will get a blank page and then it will suddenly appear in front of them.<\/li>\n <li>There&#8217;s overhead involved, so it looks like some admins keep it off due to server load. (Aside: it looks like Wikipedia compresses everything, even dynamically-generated content.)<\/li>\n<\/ul>\n<p>But I&#8217;ve come across something interesting&#8230; A <a href=\"http:\/\/www.aha.com\/show_prod.php?id=32\">Hardware gzip Compression Card<\/a>, apparently capable of handling 3 Gbits\/second. I can&#8217;t find it for sale anywhere, nor a price mentioned, but I think it would be interesting to set up a sort of <a href=\"http:\/\/www.squid-cache.org\/\">squid<\/a> proxy that would sit between clients and the back-end servers, seamlessly compressing outgoing content to save bandwidth.<\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve alluded before to using gzip compression on webserver. HTML is very compressible, so servers moving tremendous amounts of text\/HTML would see a major reduction in bandwidth. (Images and such would not see much of a benefit, as they&#8217;re already &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/05\/08\/web-compression\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,10,19,22,24],"tags":[],"class_list":["post-733","post","type-post","status-publish","format-standard","hentry","category-computers","category-cool-links","category-ideas","category-performance","category-programming","category-rants-raves"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=733"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/733\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}