why png size doesn't change after using http gzip compression

Mark Ma picture Mark Ma · Jul 2, 2012 · Viewed 27.5k times · Source

I use following .htaccess to set gzip compression:

AddOutputFilterByType DEFLATE text/html image/png image/jpeg text/css text/javascript

Please check this url: http://www.coinex.com/cn/silver_panda/proof/china_1984_27_gram_silver_panda_coin/

the gzip compression works for html, css, js and jpg, but not working for png (really amazing..)

Answer

Rob Trickey picture Rob Trickey · Jul 2, 2012

PNG is already a compressed data format. Compressing it with GZIP is not likely to decrease the size, and can in fact make it larger.

I'm surprised you're seeing benefits when GZIP-ing JPGs, as they are also compressed.

See here for Google's tips on using GZIP. They recommend not applying it to images.