避免加载 CSS 文件时出现链接关键请求问题 [PageSpeed Insights]
我想知道如何删除或减少 css 加载时间。 PageSpeed Insights 建议我应该“避免链接关键请求”。加载时间预计会增加约 170 毫秒。
我尝试过加载延迟/异步,但它只会导致大量的布局变化。文件大小约为8KiB。
是否有任何简单而现代的解决方案可以在 HTML 之前加载它,但不会阻止加载过程?
I want to know how I can remove or reduce the time that my css takes to load. PageSpeed Insights suggests that I should 'Avoid chaining critical requests'. It is supposed to add about 170ms give or take to the loading time.
I have tried loading deferred/async but it just results in massive layout shifts. The file size is about 8KiB.
Are there any simple and modern solutions to load it before HTML but not block the loading process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以拆分CSS。将布局关键 CSS 内联或同步加载,其余部分可以异步加载。
You could split the CSS. Have layout critical CSS either inlined or sync loaded, and the rest you can async load.