In SEO site optimization, in fact, the performance of the site for the search, but also has a great impact, such as speed, if the site opened fast, then the search engine spider program in the download page, in the same time, will download more pages, so that under other conditions the same conditions, can be relative to the collection of more pages, and the site's loading speed, for the user experience, is also very good for a Web page, if the opening speed over a certain limit, users will directly turn off this page, so the performance of the site optimization, not only is the user's needs, But also the need of search engines. Below from my personal experience, to introduce how to optimize the speed of the site.
If you often look at Google Webmaster help articles, you will know that Google will often mention page speed and Yahoo YSlow These two plug-ins, for me, I am the combination of these two uses, but the content is similar, below I will introduce how to use page Speed to optimize the site. Using page speed, you need to first install a Firefox browser, Firefox is supported by the page speed plug-in, but also to install a firebug,page speed is running in the Firebug environment. After these installations, turn on the Firefox browser: tool-firebug-Open Firebug, open the interface as shown:
Then click the Analyze Performance button and start to run page speed check the site. Below is the results of my personal blog site:
In turn, we explain the above:
1. Use browser caching:
My personal blog Many files do not specify an expiration date, because I am using the virtual space of the network, all the settings above the server need to be through the space provider to complete, in fact, these files mentioned above, you need to specify a minimum of one week of validity, this can improve the loading speed of the page. Improve the user's physical ability, and the search engine's crawl also greatly help.
2, the combination of pictures to map positioning
These pictures, because they are not small, occupy a little space, you can use CSS sprites technology to map the whole and then use CSS technology, in the corresponding place to call the different locations of the picture, that is, CSS Wizard technology. This is not too difficult to do, but after doing, the effect is very good, greatly reducing the number of HTTP requests, improve the loading speed of the page.
3. Enable compression
In general, the site is best to enable gzip compression, so the transmission speed will be much faster, gzip technology is in the server to transfer files to the client browser before the compression, transmission is compressed format files, which greatly improve the network transmission speed, when the browser to transfer to the server to send data, is decompressed for proper display.
4. Enable Keep-alive
The so-called keep-alive can be understood as a common connection, generally speaking, HTTP requests are closed immediately after use, so that when the Keep-alive connection is enabled, the connection time can be maintained for a period of time, so no longer to the server to make new requests, greatly reducing the speed of the page load, Enable Keep-alive is set inside the server, set the header of the appropriate file.
5, to avoid the wrong request
Our website, to minimize the occurrence of some of the wrong requests, such as 404 Code, 410, etc., if these, will greatly waste the server resources, and we also want to use less than 301, 302 and other jumps, each jump, not only will prolong the loading speed, but also occupy a part of the server resources.
6. Avoid using @import in CSS
7. Pause JavaScript parsing
We use the JS code in the page, to minimize the use, if you want to use, you should try to put the JS code behind the page. Do not put too much JS code to the front of the text, otherwise it will affect the loading speed of the page. Well, of course, this tool to check out a lot of problems, I will not write out, the next one I write this series. This article is edited by http://www.tingbaobei.com/, reprint please indicate the source, thank you