This rule is triggered when PageSpeed Insights detects that the system needs to make more network round trips to render the first screen content of a web page.
If the amount of data required exceeds the limit of the initial congestion window, the system needs to make more round trips between the server and the user's browser. If the user is using a network with a long delay time (for example, a mobile network), this problem will seriously delay the loading of web pages.
To speed up Web page loading, limit the size of data (HTML tags, pictures, CSS, and JavaScript) required to render the content of the first screen of a Web page. To do this, you can try the following methods:請首先加載網(wǎng)頁的主要內容。結構化網(wǎng)頁,以便服務器發(fā)出的初始響應能發(fā)送必要數(shù)據(jù),從而迅速呈現(xiàn)網(wǎng)頁的關鍵部分并暫緩呈現(xiàn)其余部分。這可能意味著,您必須將CSS拆分為兩個部分:負責調整內容ATF部分的格式的內嵌部分,以及可暫緩呈現(xiàn)的部分。
參考以下示例,了解有關如何結構化網(wǎng)站以提高加載速度:
- 如果您的HTML先加載第三方小部件,再加載主要內容,請將該加載順序更改為先加載主要內容。
- If your site has a two-column layout (navigation sidebar plus article) and HTML loads the sidebar before the article, consider loading the article first.
- 縮減資源的大小:通過移除不必要的空格和評論來縮減HTML、CSS和JavaScript的大小。通過使用可重命名資源中變量名稱的工具,實現(xiàn)進一步的優(yōu)化。
- 盡可能考慮Use CSS instead of pictures.
- 啟用壓縮功能
Except as otherwise noted, the content of this page is licensed under the?Creative Commons Attribution 3.0 License, and code samples are licensed under the?Apache 2.0 License. For details, see ourSite Policies.
