简体   繁体   English

为什么 Google Pagespeed Insights 在进行更改后不更新分数?

[英]Why Google Pagespeed Insights is not updating the score after making changes?

I have a site.我有一个网站。 I tested it in Google Pagespeed Insights and it gave me some suggestions.我在 Google Pagespeed Insights 中对其进行了测试,它给了我一些建议。 I changed the issues.我改变了问题。 I deleted some files.我删除了一些文件。 But it's still showing the same result and giving the same suggestions.但它仍然显示相同的结果并给出相同的建议。 Gtmetrix is showing the changes, but Google Pagespeed Insights is not. Gtmetrix 正在显示更改,但 Google Pagespeed Insights 没有。 Can anyone tell me what is the reason?谁能告诉我是什么原因? Site Link: https://www.galpal.co.uk/网站链接: https://www.galpal.co.uk/

You are getting this error because the file is still referenced in the HTML.您收到此错误是因为 HTML 中仍引用该文件。

显示在 HTML 源代码中仍然引用文件的第 76 行

Because the browser doesn't know that you have deleted the file off your server it still makes the request as you left a reference to it in your HTML.因为浏览器不知道您已经从服务器上删除了该文件,它仍然会发出请求,因为您在 HTML 中留下了对它的引用。

Even thought the file returns 404 not found there is still a request made for the file.即使文件返回 404 not found 仍然存在对该文件的请求。 At this point that is something that will block rendering of the above the fold content.在这一点上,这将阻止呈现上述折叠内容。

注释中指定的文件仍然列出

Remove the reference in your HTML (remove the <script> element referencing the file) and Page Speed Insights will reflect the change.删除 HTML 中的引用(删除引用文件的<script>元素),Page Speed Insights 将反映更改。

To be clear GT Metrix is wrong here and Page Speed Insights is correct.需要明确的是,GT Metrix 在这里是错误的,而 Page Speed Insights 是正确的。

ps - you should add defer attribute (or async but that is more difficult) to your scripts ps - 你应该在你的脚本中添加defer属性(或async ,但这更难)

<script src="yourJavaScriptFile.js" defer></script>

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

相关问题 如何提高从Google PageSpeed Insights获得低分的WordPress WooCommerce网站的性能? - How can I improve the performance of a WordPress WooCommerce website that gets a low speed score from Google PageSpeed Insights? 如何降低我在 PageSpeed Insights 上的 LCP 分数? - How can I lower my LCP score on PageSpeed Insights? CakePHP Google PageSpeed Insights利用浏览器缓存 - CakePHP Google PageSpeed Insights Leverage browser caching 像Google的PageSpeed Insights一样无损地压缩图像 - Losslessly compress image as much as Google's PageSpeed Insights Pagespeed见解报告分析 - Pagespeed insights report Analysis 如何在移动设备上提高 Google PageSpeed 洞察力得分? - How do I increase Google PageSpeed insight Score on mobile? 为什么Google PageSpeed抱怨Retina图片? - Why is Google PageSpeed complaining about Retina images? 如何应用 pagespeed 洞察结果 - How to apply pagespeed insights results 是否可以使用Google PageSpeed Insights API检索URL的服务器响应时间? - Is it possible to retrieve the server response time for a URL using the Google PageSpeed Insights API? Google PageSpeed Insights API 无法连接到我的 Wordpress 博客来测试速度 - Google PageSpeed Insights API can't connect to my Wordpress blog to test speed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM