简体   繁体   English

Google PageSpeed Insights的问题-优先显示可见内容

[英]Issue with Google PageSpeed Insights - Prioritize Visible Content

While developing a full-fledged website for a client, who is slightly obsessed with Google tools and suggestions, I've come across the following issue: 在为客户开发一个功能完善的网站时,我对Google的工具和建议有些痴迷,但我遇到了以下问题:

No matter what I do, I cannot achieve a perfect score for the homepage of the site. 无论我做什么,都无法获得网站首页的完美分数。 All other pages are 100/100 on both mobile and desktop, but the landing page gets 91 and 97 respectively - as you can see in the attached pictures. 在移动设备和台式机上,所有其他页面均为100/100,但登录页面分别为91和97-如您在所附图片中所见。

桌面结果 移动结果

I have tried all relevant steps I could find, including correctly structuring the HTML code and asynchronously loading everything else, plus lazy-loading the images. 我已经尝试了所有可能找到的相关步骤,包括正确构造HTML代码和异步加载其他所有内容,以及延迟加载图像。

A dummy representation of the code would be this: 代码的虚拟表示是这样的:

html head, metatags etc
inline blocks of css (to "fix" the render-blocking issues)
the html content, in correct order with above-the-fold first
deferred js load

My question is, what am I missing? 我的问题是,我想念什么? What else can I do to achieve the perfect score? 我还能做些什么来获得满分?

For future reference and anyone facing the same problem: 供以后参考,以及遇到相同问题的任何人:

I've solved this issue by reducing the filesize for my homepage PHP file. 我已经通过减少主页PHP文件的文件大小解决了这个问题。 This was nowhere in the guidelines or the responses around the web, but it was the thing that bumped me up to 100/100. 这在准则或网络上的响应中没有出现,但这是使我达到100/100的原因。

In my particular instance, I removed every last bit of unnecessary CSS I had included. 在我的特定实例中,我删除了包含的所有不必要的CSS。 That alone reduced the size and removed the error. 仅此一个就减小了大小并消除了错误。

I consider the issue erroneous however, and will proceed to report this to Google - as "prioritize visible content" has nothing to do with "reduce your file size". 我认为这个问题是错误的,因此将继续向Google报告-因为“优先显示可见内容”与“减小文件大小”无关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM