Font-Face仅适用于IE中的首页加载 [英] Font-Face Only Works on First Page Load in IE
问题描述
我们有一个实现自定义字体的网站。
这个每次在我们的测试服务器上的IE工作。当我们转向生产时,它只能在第一次加载页面时工作。如果我删除我的临时互联网文件并重新加载页面它将再次工作。
我用字体松鼠来制作他们所谓的防弹css。
CSS如下:
Hi,
We have the a website which implements a custom font face.
This work every time in IE on our test server. When we move to production it works but only the first time it loads the page. If I delete my temp internet file and reload the page it will work again.
I've used font squirrel to produce their so called "bullet proof" css.
The CSS is as follows:
@font-face {
font-family: 'My Font';
src: url('my_font.eot');
src: url('my_font.eot?#iefix') format('embedded-opentype'),
url('my_font.woff') format('woff'),
url('my_font.ttf') format('truetype'),
url('my_font.svg#my_font') format('svg');
font-weight: Bold;
font-style: normal;
}
我有mime类型如下:
.eot application / octet-stream
.woff application / x-font-woff
.ttf application / octet -stream
.svg image / svg + xml
任何帮助都会受到赞赏......这个问题让我抓狂!也被我们的客户追逐!
此外,当我运行网络跟踪时,我可以看到IE成功加载所有请求的字体文件。 IE加载EOT,TTF和WOFF。
I have the mime types as follows:
.eot application/octet-stream
.woff application/x-font-woff
.ttf application/octet-stream
.svg image/svg+xml
Any help would be appreciated... This problem is driving me crazy! Also getting chased by our client too!
Furthermore, when I run the network trace I can see IE successfully loading the font files for all requests. IE loads the EOT, TTF and WOFF.
推荐答案
我找到了解决方案。
IE不会如果缓存关闭,则使用font-face为同一会话中的后续请求工作。
字体文件夹有
缓存控制:无缓存
到期:-1
Pragma:no-cache
除了原始请求之外,这会破坏IE中的font-face。
这绝对是一个跟踪缓存的错误,IE肯定会加载字体每个请求但都无法成功实现它们。
I found the solution.
IE will not work with font-face for subsequent requests within the same session if the caching is turned off.
The font folder had
Cache-Control: no-cache
Expires: -1
Pragma: no-cache
This breaks font-face in IE beyond all but the original request.
This is definitely a bug as tracing with caching off, IE definitely loads the fonts with each request but it fails to implement them successfully.
这篇关于Font-Face仅适用于IE中的首页加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!