Website Optimization record
Website optimization, optimized from many aspects, is divided into front-end optimization section and server (background) optimization.
Now mainly on the front-end optimization of the section, this is from my own when the site optimization is recorded. First of all, the front-end optimization aspects, from a number of aspects, mainly picture files, file links, HTML code structure, CSS optimization and so on. Use tools more, first to detect the performance of the Web site tools.
Tools and methods for detecting site performance:
Through detection, you can more accurately find the site loading slow and improve the plan.
1. The simplest method.
WebKit Kernel (google) browser F12-Call up Debugging tools-Check network, then refresh the site, you can see the specific data, the next line, the number of requests to connect, the size of the resource file, the total page load time (file load time, DOM node parsing time)
This is also more commonly used, relatively simple, but also has a very detailed information, you can test yourself.
2. There is a special Google plugin or Firefox plugin or JS plugin to check.
Performance.js has Google plugin
Directly in the HTML to introduce a file refresh can see the resolution, but it seems that the cache refresh is not very accurate, there are 1 seconds or so error.
YUI Yahoo's YSlow
This is more powerful, can be the entire site analysis of the situation, specific people can see for themselves.
Optimization scenarios:
Tools to detect where the site needs to be optimized, this is very helpful to us ~
1. Reduce the number of HTTP files requested
2.js file recommended the use of external, characteristics, save traffic, speed, or gzip compression, when loading the external can be written as such, if the external failure can also load local.
3.js,css file compression
4. Reduce DOM structure depth, as concise and simple as possible
5.CSS minimize the use of inefficient selectors and nesting depths best not to exceed the layers
6. According to the website needs the function delay effect JS file load, to ensure the speed of opening the homepage.
7. For picture resource files Please try to optimize, PNG and JGP, GIF is commonly used in picture format, PS Cut chart ensures that Web images are everywhere, not saved as * * format.