With the rapid development of the Internet, user experience has to be said to be a top priority. At the same time, search engines are also concerned about website speed. I think you as webmasters should all know this, so I won’t say more, Get straight to the point. This article is my original content and is based on my experience as a webmaster for so many years. I hope you guys can pass it!
1. Let’s talk about two examples first, how to test the opening speed of your website:
1. How to check the response speed of your website: PING your website in CMD to see how long it takes to reflect, for example: ping www.***.com , you will see how many ms time equals.
2. You can also enter the website performance option in GOOGLE webmaster tools, which will have a performance overview of your website.
2. Now let’s analyze how to improve your website speed:
1. It is best to use static pages and website layout using DIV+CSS
Because static pages do not need to call your database or the like, it relieves the server of a major parsing step. If you don’t believe me, you can test it. Again, why not use TABLE layout, because TABLE will not be displayed until all the contents are loaded. The DIV+CSS layout is not, so please use the DIV+CSS layout for your website.
2. Turn on GZip compression on the website
When your website turns on GZIP compression, it will reduce the amount of data transmitted over the network. The method of turning on GZIP compression is as follows (static page under WINDOWS host): Create a directory on the hard disk, name it "IUSR_machine name" and write access permissions. Then enter the IIS manager, right-click "Website" - Properties, enter the "Service" tab, and compress static content. Then select the server extension under the website and create a new server extension. The extension file is: c:windowssystem32inetsrvgzip.dll.
3. Page weight loss
Remove some useless codes and comments on your website, especially some useless JS codes. If you don’t know whether some codes are useful or not, just remove them one by one!
4. Overall image optimization of the website
I don’t know if the images used on your website have been optimized, but I often optimize the images on my website, because after the images are optimized, the image size can even be reduced to half.
5. Optimize ads on your website
I believe that every webmaster will have advertisements on their website, but these advertisements often affect the speed of finding your website to a large extent. I suggest that you use iframe nesting if you can use iframe nesting. If the GOOGLE alliance cannot be nested, I will give you another method. The principle of this method is to load the advertising content in the last part. The code is as follows:
<div id="myads">Loading...</div>----Put it here where you want to put the advertisement.
<span id="span_myads">----Place the following code at the bottom of the page
<script src='/plus/ad_js.php?aid=3' language='javascript'></script>----Here is the advertising code of your website
</span>
<script type="text/Javascript">
document.getElementById("myads").innerHTML = document.getElementById("span_myads").innerHTML;
document.getElementById("span_myads").innerHTML = "";
</script>
6. External encapsulation call of JS code in the website
JS code cannot be read by search engines. Too much JS code on your website will not only increase the size of your page, but may even make spiders dislike your website. At the same time, if the JS called at this time can be placed at the bottom of the website, try to put it at the bottom!
7. Website statistics code and now popular sharing button code optimization
It is best to put this kind of code at the bottom of the website, because this kind of code calls things on other people's servers. If you put it at the top of the page, then it is conceivable that other people's things will be loaded first, and then loaded on your server. Can the website open faster like this?
8. Friendly links
It is recommended that you use text links instead of picture links. If you use picture links, please put the LOGO of other people's websites on your own server.
The details are not detailed and will be continued later. The author of this text: Funnyba http://www.funnyba.com Please indicate the source for reprinting.
Thanks to iamislida for your contribution