简体   繁体   English

为什么浏览器在加载网页资源时停了一段时间?

[英]Why browser stops for a while loading web page resources?

I am testing a website on gtmetrix ( https://gtmetrix.com/reports/www.winni.in/Wvpln9Q6 ) and in reports generated by gtmetrix I always see few lags, during which no resource loads and after some milliseconds it starts again. 我正在gtmetrix上测试一个网站( https://gtmetrix.com/reports/www.winni.in/Wvpln9Q6 ),并且在gtmetrix生成的报告中,我总是看到一些延迟,在此期间没有资源加载,并且在几毫秒后它又重新开始。 Please check report in above link, I have also attached image below for that report for better understanding 请检查上面链接中的报告,我也附有下面的图像以更好地理解该报告

在此处输入图片说明

Here after html page load, it halts for about 250ms and then it starts loading css file. 在html页面加载后,它会暂停约250ms,然后开始加载css文件。 After fetching few files it stops for a while after fetching init.min.js . 在获取了几个文件之后,它在获取init.min.js之后停止了一段时间。 After that it starts again and stops for a while again after loading analytics.js . 之后,它将再次启动,并在加载analytics.js之后再次停止一段时间。

Due to this, overall page load time increases a lot. 因此,整个页面加载时间增加了很多。 Which otherwise would be less if it does not halt while fetching files. 如果在获取文件时不停止运行,则不会那么多。

Questions are: 问题是:

  1. Why does it happen like this? 为什么会这样发生? I have not seen like this on other websites 我没有在其他网站上看到这样的东西
  2. What is the solution for this? 有什么解决方案?

Looking at your screen shot I thinks what is slowing your loading I think it is the Fonts woff file. 看您的屏幕截图,我认为是什么在减慢您的加载速度,我认为这是Fonts woff文件。

Read this article about fonts optimization from Google https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization 从Google https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization阅读有关字体优化的文章

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

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