PC and mobile performance optimization

One: request.

1. Reduce http requests.

2. Set up static cache .

3. Reduce cookie size and do cookie isolation

Because the cookie will be carried to the server when the http request is made, its size will have an impact, and then it is best to use a different domain name for static resources, because cookies cannot be cross-domain by default, so this is done The cookies requested for static resources under different domain names are isolated.

Two: html

1. Reduce element level nesting.

2.src and herf cannot be empty.

3. Avoid using slow elements such as table and iframe.

Three: js

1.js is written at the end of the body.

2. Load js resources asynchronously.

3. Reduce dom operations.

4. Compress the code

Four: css

1. scc is written in the body header

2. Try to avoid using CSS expressions and CSS filters

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325640793&siteId=291194637