@font-face EOT 未通过 HTTPS 加载 [英] @font-face EOT not loading over HTTPS
问题描述
我在 IE 7,8,9 中通过 HTTPS 使用 @font-face 时遇到问题 - 它根本没有加载.包含的 HTML 页面是否托管在 HTTPS 上并不重要,当我尝试通过 HTTP 加载 EOT 字体时,它可以工作,而 HTTPS 则不行.有没有人见过这种行为?
I'm running into an issue using @font-face over HTTPS in IE 7,8,9 - it simply is not loading. It does not matter whether the containing HTML page is hosted on HTTPS or not, when I try to load the EOT font over HTTP it works, HTTPS it doesn't. Has anyone seen this behavior?
托管字体的服务器正在发送正确的 content-type="application/vnd.ms-fontobject"
The server hosting the font is sending the proper content-type="application/vnd.ms-fontobject"
我尝试了多种字体,所以它不是特定于字体的.
I've tried multiple fonts, so it's not specific to the font.
字体是在 Font Squirrel
@font-face {
font-family: 'GothamCondensedBold';
src:url('path/to/fontgothmbcd-webfont.eot');
src:url('path/to/fontgothmbcd-webfont.eot?#iefix') format('embedded-opentype'),
url('path/to/fontgothmbcd-webfont.woff') format('woff'),
url('path/to/fontgothmbcd-webfont.ttf') format('truetype'),
url('path/to/fontgothmbcd-webfont.svg#GothamCondensedBold') format('svg');
font-weight: normal;
font-style: normal;
}
示例页面
http://gregnettles.net/dev/font-face-test.html>
推荐答案
我知道这是一个旧线程,但我只是不得不权衡一下.我们在所有版本的 Internet Explorer (7-11) 不通过 HTTPS 加载.经过数小时的反复试验并将我们的标头与其他工作站点进行比较,我们发现是 vary
标头将事情搞砸了.取消设置这些文件类型的标头立即解决了我们的问题.
I know this is an old thread but I just had to weigh in. We had the same issue with EOT and WOFF fonts in all versions of Internet Explorer (7-11) not loading over HTTPS. After hours of trial and error and comparing our headers with other working sites we found it was the vary
header that was messing things up. Unsetting that header for those file types fixed our issue right away.
<FilesMatch ".(woff)$">
Header unset Vary
</FilesMatch>
<FilesMatch ".(eot)$">
Header unset Vary
</FilesMatch>
奖励阅读
- 埃里克·劳伦斯:因人而异 (存档)
- IE 博客:Internet Explorer 9 中的缓存改进 (archive)
这篇关于@font-face EOT 未通过 HTTPS 加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!