Saturday, January 28, 2012

GZip compression broken on Safari, Android?

I just tried testing the board page layout on devices other than Chrome on my Macbook, and had some surprising results. I use Tomcat for my app server for my java war file, and in my war file I have configured a GZip stream compressor I wrote years ago. Unknown to a lot of web users, browsers tell the servers if they support GZip compression for content, then the server can send the data back compressed for faster downloads. I just enabled this compression on the server side for .js and .css files, since the jQuery 7 .js file is over 100k. On Chrome this works fine, but on Safari on my Macbook and on the default browser on my Android phone the whole page broke. The reason seemed to be that those browsers were telling my server they supported GZip compression for those resources, but wasn't decompressing the data I sent down! I turned on the compression on my server for .js and .css files and, sure enough, the page started working again. Very weird, I'll have to report that to Google and Apple.

No comments:

Post a Comment