Why are iframes so slow?

前端 未结 3 1482
我在风中等你
我在风中等你 2021-01-31 17:36

I have little bit longer question for you - but hope answer will be very simple :)

Let\'s say I have very simple page with link and iframe (just for simple example).

3条回答
  •  无人共我
    2021-01-31 18:11

    Although the browsers have improved since 2009, the fact that the browser needs to hit additional servers (assuming the iframes are for thrid-party content), or hit the local server again (assuming the iframes are for local content), this would still impact page performance. In general, additional HTTP requests will always have an impact on a page's performance. If it's possible to build the iframe after the page is loaded and than render the iframe's content, this would improve the initial page load. However, I think this would impact the pages performance while the iframe loads the additional content.

提交回复
热议问题