简体   繁体   中英

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. 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. Can anyone tell me what is the reason? Site Link: https://www.galpal.co.uk/

You are getting this error because the file is still referenced in the 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.

Even thought the file returns 404 not found there is still a request made for the file. 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.

To be clear GT Metrix is wrong here and Page Speed Insights is correct.

ps - you should add defer attribute (or async but that is more difficult) to your scripts

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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