For web designers, the speed of access to the site is even more important than the content. Even if the site content is very good, but if the speed of access is very slow, I believe there will not be many people waiting patiently. The following describes some of the sites I tried to lose weight, the effect is good, the figures in the illustration is my blog before and after the data comparison chart, but also hope that in the future design of the site can pay more attention to the following several items.
1: Compress the document with gzip: Gzip encoding is a way to improve the performance of Web pages, not only to reduce storage space, but also to reduce the time required for transmission. Using gzip compression for files in your Web site can significantly increase page load speed and reduce the bandwidth consumption of your Web site. (using this method can add to the burden on the server because the server configuration needs to be modified and is not operational for virtual host users.) )
Extended reading:
How to configure the Gzip compression feature for Tomcat,apache
How to enable gzip compression for IIS on a detailed
2:css Compression Weight loss tool http://www.xland.com.cn/css/geshihuacss.htm
Copy your website CSS code into this box, click Compress, generally can be compressed 1-5k css. My blog CSS code shrinks by 2K.
3: Weight loss for JavaScript files: This method differs from gzip compression functionality, there are many ways to narrow down JavaScript documents, where JS online weight loss website is recommended: http://javascriptcompressor.com/
4: Place the stylesheet file in an external call: place the JavaScript and CSS style sheet files that are needed in the page in a separate folder so that the called files are cached when the other pages of the site are opened, speeding up the loading of the site pages.
5: Use GIF format as much as possible for website images. gif format pictures occupy a small space, such as my blog's illustrations, jpg format pictures generally between 10-50k, and GIF format pictures are generally 10K or less.
6: Try not to call too large Flash files and video files on the home page.
7: Avoid Web redirection: whether through server end multiplicity orientation or content redirection via JavaScript code, the site will load a blank page first and then redirect to another page, which not only extends the load time of the page, There is also a good chance that you will not be able to jump and let the user face a "blank" page. Read more: How to use web redirection correctly
8: Put the statistics code at the bottom of the site: do not share the page content with a table or div tag. You can place the statistic code directly at the bottom of the page code, or at the bottom of a table or div to place the counter. This way, when the counter cannot be accessed, your website speed will not be affected in the slightest.
finally introduce my blog to test the speed of the site http://loadimpact.com
Enter the URL of the website you want to test in the text box lusongsong.com, and then click the Start Test button to start testing the website speed. For a while, you can count some detailed loading data for loading the site. Including the whole loading and the station picture as well as JavaScript, CSS and other code loading. You can select different files in the right-hand list to compare the loading data of up to three objects at a time. And in the Loadimpact website can also generate chart display, convenient for us to analyze. By generating the data, you will know where the bottleneck of your website speed is, and further solve the problem.