[Cialug] gzipped js and css with no app server

Tom Pohl tom at tcpconsulting.com
Fri Jan 18 10:49:00 CST 2008


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:

http://joseph.randomnetworks.com/archives/2006/07/13/compressed- 
javascript/

-Tom



On Jan 17, 2008, at 9:17 PM, Matthew Nuzum wrote:

> 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.
>
> 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.
>
> 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 http://dean.edwards.name/ 
> packer/)
>
> 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: http://www.bearfruit.org/blog/2008/01/17/ 
> using-gzip-compressed-js-and-css-without-an-app-server
>
> -- 
> Matthew Nuzum
> newz2000 on freenode
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/cialug/attachments/20080118/0f0c7c9e/attachment.html


More information about the Cialug mailing list