【发布时间】:2015-03-29 21:48:33
【问题描述】:
今天我将Font Awesome 包更新为4.3.0,并注意到添加了woff2 字体。该文件在 CSS 中链接,因此我需要配置 nginx 以正确提供 woff2 文件。
目前我在 nginx 配置中有这个块用于字体:
location ~* \.(otf|eot|woff|ttf)$ {
types {font/opentype otf;}
types {application/vnd.ms-fontobject eot;}
types {font/truetype ttf;}
types {application/font-woff woff;}
}
woff2 字体的正确 mime 类型是什么?
【问题讨论】:
-
在 Apache 中缓存 woff2 文件的方法如下:
<IfModule mod_mime.c> AddType font/woff2 woff2和<IfModule mod_expires.c> ExpiresActive On ExpiresByType font/woff2 "access plus 1 month"。 (省略了结束标签和换行符。)
标签: fonts mime-types woff woff2