"Preload key requests" 页面速度洞察中的问题,但代码中的标记存在

"Preload key requests" problem in page speed insight, but the tag in code exists

我有一个网站 https://www.budowle.pl/,我想对其进行优化并提高其在 Google Page Speed Insight 中的得分。

我遇到的问题之一是:

Preload key requests
1.68 pp
Consider using `<link rel = preload>` to prioritize fetching resources that are currently requested later in page load. Learn more.
URL
Potential Savings
/fonts/icons.ttf?myrw8(www.budowle.pl)

https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fwww.budowle.pl&tab=mobile

我还没有找到处理它的方法:(

在我的代码中(据我说:))正确的标签:

<link rel="preload" href="https://www.budowle.pl/fonts/icons.woff?myrw8" as="font" type="font/woff" crossorigin>

我也试过,没有这个参数?myrw8,但是没有成功。

如果有人知道我能做什么,我将不胜感激。

亲切的问候,Wojtek

嗯,问题是你看错了文件:-P

您已正确完成“图标。woff”的所有操作,但您还没有rel="preload"“图标。ttf”文件。

这似乎在您的 main.css 文件中被引用。

现在 woff font format has very good support you may decide to remove the reference to the ttf format (which would probably be my recommendation as the browsers that don't support woff don't support ttf anyway 除了非常旧的 android 设备(低于 4.4 版)),如果不是,只需以相同的方式为 ttf 文件添加预加载。

<link rel="preload" href="https://www.budowle.pl/fonts/icons.ttf?myrw8" as="font" type="font/ttf" crossorigin>