消除外部渲染阻塞 [英] Eliminate external render-blocking
问题描述
PageSpeed Insights建议我:
PageSpeed Insights suggests me to:
在首屏内容中消除外部渲染屏蔽Javascript和CSS。有1个阻塞的CSS资源,这会导致渲染页面的延迟。优化CSS交付以下资源:
http:/ /itransformer.es/css/c0f9425.css
css文件 c0f9425.css
是 jquery-ui.css
文件和自定义文件的组合文件。
The css file c0f9425.css
is the combined file with jquery-ui.css
file and custom one.
我真的不明白这一点。我应该如何遵循这个建议?
I don't really understand this point. How should I follow this suggestion?
推荐答案
Google建议您将最初需要的CSS放在CSS中,页面加载就绪。 请参阅此处。
Google suggests you to put the initially needed (above-the-fold) CSS inline and load the rest of the CSS when the page load is ready. See here.
同样适用于javascript。 在此处建议,在网页加载时加入必须具有代码并加载网页加载不错的代码 >
Same goes for the javascript. Include the "must have code" inline and load the "nice to have code" on page load as suggested here
建议是加载用户首先尽快查看的内容。
Idea is to load what the user sees first as fast as possible.
跟随,因为它会拆分代码,使维护更困难。对大型项目有意义,但...
Personally I find it hard to follow as it would split the code and makes maintaining it harder. Makes sense for large projects though…
这篇关于消除外部渲染阻塞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!