Why is there a time span between different network requests?

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:33:19

问题


I'm optimizing the loading times in a web app and I don't know what's the problem. Firebug's Net panel is showing time holes between requests.

Can someone explain me this chart?


回答1:


The gap between the requests can have two reasons:

  1. Time needed to parse the requested page

    When you request a URL, the browser needs to parse the returned contents to check whether they contain URLs to other ressources like JavaScripts, CSS files, images, etc. Subsequently requested ressources need to be parsed, too. So e.g. CSS files can contain references to images. Though the contents of the CSS file first need to be parsed to get those URLs.

  2. Dynamically requested ressources

    Using JavaScript resources can be requested asynchronously. These requests can be triggered e.g. through AJAX or by dynamically inserting DOM nodes like <img src="xyz.png" alt=""> into the page.



来源:https://stackoverflow.com/questions/31345263/why-is-there-a-time-span-between-different-network-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!