In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use color to distinguish the application rules of HTML optimization techniques, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
We know that HTML is an essential part of the whole front-end composition, and it is a real display of "front-end", so it is necessary to optimize HTML effectively.
Although compared with more than 10 K of Javascript, the size of HTML generally does not account for too much of the page resources, and there are Gzip, but the facts show that most pages have greater room for compression, even after Gzip can still reduce considerable volume.
For various optimization approaches, if I have to give a classification, I will use color to distinguish. For those methods that are applicable and harmless in all kinds of pages, I classify them as green. Relatively speaking, methods that apply or violate the standard are classified as orange only in some specific cases.
Green method
1. Use relative URL
For all kinds of URL in the page, such as link, href of outer chain CSS, src of outer chain Javascript, picture src, iframe src, etc., if you can make sure that they are under the same domain name as the current page, you can use relative URL, so that each URL can save at least one domain name.
two。 Delete HTTP or HTTPS
Absolute URL starts with a protocol header such as HTTP or HTTPS. If you can determine that the protocol of URL is consistent with that of the current page URL, or that the URL is available under a variety of protocols, you can consider deleting this protocol header.
Although this is somewhat non-mainstream, it has been proved to be feasible and has a theoretical basis. Some of the resources on this page of Nexus One, URL, delete the protocol header, although it is not for the purpose of saving resources, but at least it proves that deleting the protocol header is feasible. For CSS, if deleting the protocol header under IE7 or IE8 will cause CSS to download twice, this is a problem that needs to be paid attention to.
3. Delete comment
Like CSS and Javascript, optimization can be achieved by removing comments in HTML. However, this is a little more complicated for HTML because there are some special comments in HTML that cannot be deleted.
(a). IE condition comment
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.