Frontend Performance Optimization

Source: Internet
Author: User

 

First, we must understand the optimization objects and clarify the optimization objectives so that we can adopt the correct optimization methods.

1. Optimization objects

--> Front end!

First, you must know the steps to open a webpage:

We can see that there are three main parts: Network, server, and browser.

After learning about the optimization object, we can optimize each part.

2. optimization objectives

--> Time! (Primary goal)

3. Optimization Methods

--> Hierarchical optimization!

First, understand the three-tier model to be optimized:

For more information about this model, see http://www.w3.org/TR/navigation-timing/

For the network layer, the optimization principle is:

1. Reduce redirection and bad connections

2. Streamline the number of static resources and the number of domain names on the hosts page.

3. enable caching

4. Exercise caution when using cookies and Https for the producer (cookis will bring a lot of data to the server to increase traffic; https requires more SSL requests)

For the server layer, the optimization principle is:

1. Return the first byte of content as soon as possible

2. asynchronously load the html content at the bottom of the page

3. Compress html and enable gzip.

For the browser layer, the optimization principle is:

1. Place CSS on the top of the page

2. Optimize the sequence of CSS and JS

3. Control the number of DOM trees

4. asynchronously load some static Resources

5. delayed execution

Example:The time consumption of each part is clearly displayed and can be optimized (the green font is the timestamp)

Source: http://www.cnblogs.com/kivi/p/3193612.html

Related Article

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.