javascript - .woff 图标仅适用于 IE 11 中的首页加载

标签 javascript css internet-explorer font-face custom-tags

我们有一个实现自定义字体的网站。

这在我们的测试服务器上的 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>

这是重新加载页面后抛出 404 not found 的图像 enter image description here

最佳答案

如果 Cache Control 设置为 no-cache font-face 在第一次加载后将无法在 IE 中工作。尝试打开和关闭缓存进行测试以帮助调试。

关于javascript - .woff 图标仅适用于 IE 11 中的首页加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48871066/

相关文章:

javascript - 如何在按下提交按钮之前将用户输入的值存储到javascript变量中

javascript - 正则表达式匹配一个额外的空组

javascript - jQuery 中的 "Converting"具有多个音轨的音频播放器

javascript - $state.go 无法在 Internet Explorer 中运行

internet-explorer - Internet Explorer 悬停行为不起作用

html - IE 无法正确对齐文本和图像

CKEditor 内容的 JavaScript 打印

javascript - 为什么我不能使用 jQuery 设置相同的高度和宽度?

php - 如何仅使用 HTML 和 CSS 为 elgg 设置主题?

javascript - div 的大小取决于另一个 div 的大小