HTML Performance Optimizations

Source: Internet
Author: User
Tags script tag browser cache sublime text

Summary:

Page optimization is the HTML code in the Web page to make the necessary adjustments, can effectively streamline the page redundant code, speed up the page display speed, reduce the page occupy the search engine server storage space, improve user experience and search engine friendly, of course, can also better highlight the theme of the page, improve the relevance of the page. Here is what I have summed up to write the HTML code to be aware of, for reference only.

1, HTML tags have always. Reduce the browser's judgment time

2. Move the script tag to the end of the HTML file because JS will block the display of the subsequent pages.

3, reduce the use of the IFRAME, because the IFRAME will add an HTTP request to prevent page loading, even if the content is empty, loading will take time

4, ID and class, on the basis of being able to see clearly, simplified naming, in the connection word containing the keyword "-", do not use ' _ '

5, keep the uniform case, the uniform case is advantageous to the browser cache, although the browser is not case-sensitive, but the standard is lowercase

6, clear the space, although the space helps us to see the code, but each space equivalent to a character, the more space, the larger the page size, such as Google, Baidu and other search engine home page removed all the blanks can be removed, enter and other characters, which can speed up the transmission of web pages. can use the DW software to bulk delete the space between the tags inside the HTML, sublime text in Ctrl + A, and then long press Shift+tab all left-aligned, clear the beginning of the line of space

7, reduce unnecessary nesting, as far as possible flat, because when the browser compiler encountered a tag to start looking for its end tag, until it matches to display its content, so when nested a lot of open page will be particularly slow.

8, reduce the comment, because too many comments not only occupy space, if there are a large number of keywords will affect search engine searches

9, use Css+div instead of table layout, remove formatting control tags such as: strong,b,i, using CSS control

10, the code to be structured, semantic

11. CSS and JavaScript are separated into separate files as far as possible

12. Remove useless labels and empty labels

13, minimize the use of discarded tags, such as B, I and so on, although the high-version browser is backward-compatible

Summary:

HTML page is displayed to the user, good code, not only to bring user friendliness, but also conducive to search engine ranking, in the production of the page simplified code structure, label semantics, standardization.

HTML Performance Optimizations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.