css - CSS Font Face 在 chrome 开发者工具中发出多个请求
问题描述
我正在使用字体从服务器下载字体文件。
问题是,当我看到 chrome 网络选项卡时,我看到多个请求获取相同的字体文件。
发出的第一个请求有 200 状态码,其余请求有 304(未修改)
有趣的是,这只发生在 chrome 中。我在 safari 和 firefox 中进行了测试,他们只发送一个请求。
下面是我的代码片段
@font-face {
font-family: 'MyFont';
src: url('https://example.com/font.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
$font-family: 'MyFont', sans-serif !important;
$font-weight: 400;
请让我知道你的意见
解决方案
推荐阅读
- sql - Spring JPA:无法提取 ResultSet,错误:“{”处或附近的语法错误
- javascript - Quill Chrome Extension Youtube hotkeys
- c# - CQRS 与 MediatR 和命令的可重用性
- java - Serialize array of LocalDate
- python - Solving a Maximum weight bipartite b-matching
- javascript - 执行位于另一个函数 Javascript 中的函数
- angular - Angular app not working in Firefox 45.7.0
- vulkan - Vulkan: Renderpass LoadOp and StoreOp synchronisation
- css - Multi-line flexbox list with text-overflow: ellipsis
- mysql - sql - 获取指定记录的最高父级