我们有一个实现自定义字体的网站。
这在我们的测试服务器上的 IE 中每次都有效。当我们转向生产时,它可以工作,但只有在第一次加载页面时。 enter image description here如果我删除我的临时 Internet 文件并重新加载页面,它将再次工作。
我使用 font squirrel 来生成他们所谓的“防弹”css。 这是我的自定义 header 代码。
这是字体代码
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?48s99');
src: url('fonts/icomoon.eot?48s99#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?48s99') format('truetype'),
url('fonts/icomoon.woff?48s99') format('woff'),
url('fonts/icomoon.svg?48s99#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
<customHeaders>
<add name="Cache-Control" value="no-cache, no-store, must-revalidate" />
<add name="Pragma" value="no-cache" />
<add name="Expires" value="-1" />
<add name="Strict-Transport-Security" value="max-age=16070400; includeSubDomains" />
</customHeaders>
最佳答案
如果 Cache Control 设置为 no-cache font-face 在第一次加载后将无法在 IE 中工作。尝试打开和关闭缓存进行测试以帮助调试。
关于javascript - .woff 图标仅适用于 IE 11 中的首页加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48871066/