如何启用Apache来压缩favicon?
FAILED - (11.6 KB, compressed = 5.7 KB - savings of 5.9 KB) - http://website/favicon.ico
答案 0 :(得分:9)
以下是我使用Nginx进行资产压缩的配置:
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain
application/x-javascript
text/xml
text/css
font/woff
application/font-woff
font/truetype
font/opentype
font/eot
application/vnd.ms-fontobject
image/svg+xml
image/x-icon;
gzip_vary on;
答案 1 :(得分:8)
从您的示例来看,失败来自WebPagetest 将下面的行添加到文件/etc/apache2/mods-enabled/deflate.conf(对于Ubuntu 12.04上的Apache 2.2):
AddOutputFilterByType DEFLATE image/x-icon
之后重新加载apache。
答案 2 :(得分:-1)
您可以使用imagemagick压缩ico文件:
compress -color 16 PATHTOORIGINAL/file.ico PATHTONEW/file.ico