本文介绍了Google警告:资源解释为字体,但使用MIME类型应用程序/八位字节流传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
/zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings/\">http://zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings /



使用以下web.config设置:

 < system.webServer> 
< staticContent>
< mimeMap fileExtension =。woffmimeType =application / font-woff/>
< / staticContent>
< /system.webServer>


I have a warning in Google for my font-face:

Resource interpreted as Font but transferred with MIME type application/octet-stream: ".../Content/Fonts/iconFont.ttf".

It works even if I have this warning but I prefer avoid this warning.

Here is my declaration:

@font-face {
  font-family: 'iconFont';
     src: url('../Fonts/iconFont.eot?#iefix') format('embedded-opentype'),
     url('../Fonts/iconFont.svg#iconFont') format('image/svg+xml'),
     url('../Fonts/iconFont.woff') format('font/x-woff'),
     url('../Fonts/iconFont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

I already search on other posts but no luck so far.

Please note that my server is IIS from Microsoft.

Any idea how can I avoid this warning?

Thanks.

解决方案

another approach on here: http://zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings/

use below settings on your web.config:

<system.webServer>
<staticContent>
  <mimeMap fileExtension=".woff" mimeType="application/font-woff"/>
</staticContent>
</system.webServer>

这篇关于Google警告:资源解释为字体,但使用MIME类型应用程序/八位字节流传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 19:36