网络检查员资源加载之间的空白时间 [英] Blank time between resource loading under network inspector

查看:257
本文介绍了网络检查员资源加载之间的空白时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究一个新网站,练习我的JS / jQuery / AJaxy技能。昨晚我想看看页面渲染多长时间,看看是否有任何区域可以清理以提高速度。当网页每次加载大约200 - 300毫秒时,网络检查员的资源负载之间会出现大量空白。





http://i.imgur.com/7ng6m.jpg



其他人看到这个或知道我能做些什么来尽量减少那段时间(讨论像html和第一个css文件之间的空白区域)?

你已经加载了一大堆图片( load > DOMContentLoaded 事件已经触发 - 时间轴中的蓝色和红色垂直线)。我可以看到图像是由JQuery库( Initiator 列)加载的,也许是为了构建一个图库或其他东西。



大概是在 onload 处理程序(这可能看起来像 $(document).ready(handler) )在您的代码中,但也可以使用其他选项)。


I've been working on a new website and practicing my JS/jQuery/AJaxy skills. Last night I wanted to take a look at how long the page was taking to render and see if there were any areas I could clean up to increase speed. While the page loads in about 200 - 300 ms every time, I'm seeing a large amount of blank space between resource loads under the network inspector.

http://i.imgur.com/7ng6m.jpg

Has anyone else seen this or know what I can do to minimize that time (talking about the blank space between like the html and the first css file)?

解决方案

You've got a bunch of images loaded just after the page has been loaded (the load and DOMContentLoaded events have fired - the blue and red vertical lines across the Timeline). I can see that the images are loaded by the JQuery library (the Initiator column), perhaps to build a gallery or something.

So, the case is that JQuery loads the images after the page load, presumably in the onload handler (this can look like $(document).ready(handler) in your code, but other options are possible, too).

这篇关于网络检查员资源加载之间的空白时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆