The key to reducing the download time of web pages is to reduce the file size. When multiple pages share some component content, you can consider separating these public parts separately. For example, we can write the script programs used by Multiple HTML pages into an independent. js file, and then call it in the following way on the page: Obviously HTML, dark crossing "Public scripts"
The key to reducing the download time of web pages is to reduce the file size. When multiple pages share some component content, you can consider separating these public parts separately. For example, we can compile the script programs used by Multiple HTML pages into an independent. js file, and then call it on the page as follows:
Script
In this way, the public file only needs to be downloaded once and then enters the buffer zone. When you call an html page that contains a public file again, the download time is significantly reduced.
Move the style sheet content to the ground
CSS is an HTML dress-up tool. It cannot be used on a beautiful Web page. There are multiple methods for referencing CSS in HTML pages. Different methods lead to different efficiency. Generally, we can define The sample control code is extracted and saved to a single. CSS file. Mark or @ import mark:
Note that the 12.16.css file does not need to include
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