Code optimization can improve the performance of your site
Optimization rules:
1. Minimize HTTP Requests
1). Merge CSS background images.
The Background-position property sets the starting position of the background image.
2). Merge style sheets and scripts.
Optimization method: Require.js
3). Compress picture
4). Avoid redirects
2. Script Run optimization
1). css written on the head
2). JavaScript written at the tail or async
3.CSS optimization
1) Try to avoid writing the style attribute in the HTML tag
2) Avoid using CSS expressions
3) A value of 0 does not need to be no matter what unit for browser compatibility and performance, the value is 0 do not bring units
4) do not misuse float,float in the rendering of the calculation is relatively large, to minimize the use of
5) Do not declare too much font-size too much font-size to trigger the efficiency of the CSS tree
4.javascript optimization
1) Try to use the ID Selector ID selector is the fastest
2) Touch Event optimizer uses Touchstart, touchend instead of click, because it quickly affects speed. However, it should be noted that touch response is too fast and easy to cause misoperation
Mobile Site performance Optimization