简体   繁体   English

Google数据洞察-JavaScript加载优化

[英]Google Insights - JavaScript loading optimization

I have a problem with optimizing my page load time. 我在优化页面加载时间方面遇到问题。 I moved my script code at end of the page, but I still have a problem with rendering blocking the download of the JavaScript files. 我将脚本代码移到了页面的末尾,但是渲染仍然存在问题,阻止了JavaScript文件的下载。

I checked my site in Firebug and I get this: 我在Firebug中检查了自己的网站,并得到了以下信息: 页面渲染阻止了JavaScript资源

Why is my code loaded before images and other elements within the page if that code is included at the end of the page? 如果页面末尾包含该代码,为什么我的代码在页面中的图像和其他元素之前加载?

Your issue is that the load time of the page request (the first one in the list) takes ~1.5 seconds - more precisely the server response time - which delays all the other requests. 您的问题是页面请求(列表中的第一个)的加载时间大约需要1.5秒-更准确地说是服务器响应时间-这会延迟所有其他请求。

So regarding the graph you need to check why the server needs that long to process the page request. 因此,对于图形,您需要检查为什么服务器需要那么长时间来处理页面请求。

Note that the page request returns the HTML of the page, which then needs to be parsed first. 请注意,页面请求返回页面的HTML,然后需要首先对其进行解析。 And after it is parsed, the other requests are started. 并且在解析之后,其他请求开始。

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

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