Is there a maximum size that web pages should be kept under?

后端 未结 6 1151
轻奢々
轻奢々 2021-01-07 19:27

When I say size I\'m talking about bytes not pixels.

I\'m curious if there is any consensus on what the maximum size should be for various categories. Specifically

6条回答
  •  渐次进展
    2021-01-07 19:47

    limit 10 TCP packets (~14 kb)

    Due to how TCP estimates the capacity of a connection (i.e. TCP Slow Start), a new TCP connection cannot immediately use the full available bandwidth between the client and the server. Because of this, the server can send up to 10 TCP packets on a new connection (~14KB) in first roundtrip, and then it must wait for client to acknowledge this data before it can grow its congestion window and proceed to deliver more data.

    Due to this TCP behavior, it is important to optimize your content to minimize the number of roundtrips required to deliver the necessary data to perform the first render of the page. Ideally, the ATF content should fit under 14KB - this allows the browser to paint the page after just one roundtrip. Also, it is important to note that the 10 packet (IW10) limit is a recent update to the TCP standard: you should ensure that your server is upgraded to latest version to take advantage of this change. Otherwise, the limit will likely be 3-4 packets!

    https://developers.google.com/speed/docs/insights/mobile

提交回复
热议问题