Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to speed up the loading speed of HTML pages

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you how to speed up the loading speed of the HTML page related knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you can get something after reading this article, let's take a look at it.

1. Page weight loss

a. Delete unnecessary comments and spaces

b. Import inline (embedded: written in HTML) css,js outer chain form

The c.HTML Tidy tool checks HTML

two。 Reduce the number of files

a. Reduce the number of files referenced on the page and reduce the number of http connections

Merge b.js and css files as soon as they can

3. Reduce domain name queries

It also takes time for a.DNS to query and resolve domain names. Reduce references to external js, css and picture resources. The less use of different domain names, the better.

4. Cache reused data

5. Optimize page loading order

a. First load the content initially displayed on the page and the js and css associated with it, and then load things related to html (pictures, flash, videos, etc., which are not displayed at first)

6. Reduce the number of inline---js

7. Use legal css tags

8. Do not use nested table

The browser loads and parses html in detail

1. The user enters the URL to send the request

two。 The browser began to load the html code and found that the tag had a tag referencing the external css file

3. The browser sends a request to load the css file, and the server returns the css

4. The browser continues to load some of the code in html, and after downloading the css file, start rendering the page

5. The browser found one in the code

The tag refers to a picture and sends a request to the server. Instead of waiting for the picture to be finished, the browser continues to render the following code.

6. The server returns the image, which occupies a certain area and affects the layout of the following paragraphs, so the browser needs to go back and re-render this part of the code.

7. The browser finds a tag containing a line of js code and runs it immediately

After the 8.js script executes this statement, if there is code such as display= "none" that modifies the DOM tree, the browser will re-render this part of the code

9. Until the end

10. If the user clicks on an event, or other events trigger js to modify the DOM tree, the browser renders the page again. If js reloads the new css file (replace), the browser will re-render the page

These are all the contents of the article "how to speed up the loading speed of HTML pages". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report