I've actually read through that article and the comments and am a bit frustrated. Spent a good part of an afternoon with Safari 3 doing experimenting. It seems to work for compressed HTML but not for js, which I find remarkable. Interestingly enough, the same thing happens with Konquerer.
<br><br>If I try to view the file <a href="http://code.bearfruit.org/~matt/gzip/gzip_test.js.gz">http://code.bearfruit.org/~matt/gzip/gzip_test.js.gz</a> it just downloads it to the desktop. But when I run a test to see the response from the server, I get:
<br><br>$ HEAD <a href="http://code.bearfruit.org/~matt/gzip/gzip_test.js.gz">http://code.bearfruit.org/~matt/gzip/gzip_test.js.gz</a><br>200 OK<br>Connection: close<br>Date: Fri, 18 Jan 2008 16:49:33 GMT<br>Accept-Ranges: bytes
<br>ETag: "7145a3-2c-abb8e3c0"<br>Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 mod_ssl/2.0.55 OpenSSL/0.9.8a<br>Content-Encoding: x-gzip<br>Content-Length: 44<br>Content-Type: application/x-javascript<br><br>I've tried changing the apache config so that instead of content-encoding: x-gzip it just sends gzip, but it changes nothing.
<br><br>The only thing I can think of is that maybe safari doesn't support gzipped css/js. You'd think that all modern browsers would though.<br><br><div class="gmail_quote">On Jan 18, 2008 10:49 AM, Tom Pohl <
<a href="mailto:tom@tcpconsulting.com">tom@tcpconsulting.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
Looks cool, but safari reports to not support gzip even though it really does. Here's a URL (comment #2) that describes what's happening:<div><br></div><div><a href="http://joseph.randomnetworks.com/archives/2006/07/13/compressed-javascript/" target="_blank">
http://joseph.randomnetworks.com/archives/2006/07/13/compressed-javascript/</a></div><div><br></div><div>-Tom</div><div><br><div><br></div><div><br><div><div><div></div><div class="Wj3C7c"><div>On Jan 17, 2008, at 9:17 PM, Matthew Nuzum wrote:
</div><br></div></div><blockquote type="cite"><div><div></div><div class="Wj3C7c">It's trivial to write a bit of PHP code that looks at the http accept-encoding header and choose to send either compressed or uncompressed data based on what you find there. However I'm in a special situation where I cannot serve dynamic content based on individual browser settings. I have a caching proxy in front of the app server and for performance reasons we don't send differing content based on browser preferences.
<br><br>I've been trying to figure out a way to detect if gzip compression is supported on the client side and then use that information to request either compressed or uncompressed js and css files.<br><br>The difference in file size really is impressive, starting at about 50% decrease in file size for small resources and improving to 70% decrease in file size as the resources get larger. Also, it allows you to use normal, non-packed js files with practically no difference in download size which makes debugging js *so* much easier. (by packing I mean something like
<a href="http://dean.edwards.name/packer/" target="_blank">http://dean.edwards.name/packer/</a>)<br><br>I've come up with a solution. It adds about 1.4k to the page weight, but in my use case saves over 20k. I've got a working example but would really appreciate a few extra eyes and any feedback. I've documented my proof of concept here and I'd love to hear your thoughts on it:
<a href="http://www.bearfruit.org/blog/2008/01/17/using-gzip-compressed-js-and-css-without-an-app-server" target="_blank">http://www.bearfruit.org/blog/2008/01/17/using-gzip-compressed-js-and-css-without-an-app-server</a>
<br clear="all"> <br>-- <br>Matthew Nuzum<br>newz2000 on freenode </div></div><div>_______________________________________________</div><div>Cialug mailing list</div><div><a href="mailto:Cialug@cialug.org" target="_blank">
Cialug@cialug.org</a></div><div><a href="http://cialug.org/mailman/listinfo/cialug" target="_blank">http://cialug.org/mailman/listinfo/cialug</a></div> </blockquote></div><br></div></div></div><br>_______________________________________________
<br>Cialug mailing list<br><a href="mailto:Cialug@cialug.org">Cialug@cialug.org</a><br><a href="http://cialug.org/mailman/listinfo/cialug" target="_blank">http://cialug.org/mailman/listinfo/cialug</a><br><br></blockquote>
</div><br><br clear="all"><br>-- <br>Matthew Nuzum<br>newz2000 on freenode