Code optimization can improve the performance of your website
Optimization rules:
1. Minimizing 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 Execution Optimizations
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 require any units for browser compatibility and performance, with a value of 0 do not bring the unit
4) do not misuse float,float in the rendering of a large amount of calculation, 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
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Mobile Site performance Optimization