Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall
Windows server's own Internet Information Server (Internet Information Server,iis) is a common tool for building Web servers, a simple and cumbersome thing, and novice users can use IIS to erect a respectable web site, But configuring, optimizing the performance of IIS, so that the performance of the Web site access is not a simple thing, here I will explain how step-by-step optimization of your IIS server.
Server-side environment, we take Windows Server 2003 IIS6.0 as an example, the client environment is Mozilla Firefox 3.0, and the Yahoo YSlow extension is installed.
YSlow is a firebug based plugin released by the Yahoo developer team. The ability to analyze Web pages and rate them according to the rules of some high-performance Web sites is a great help for Web page performance optimization, telling you which parts affect your Web page speed and how to optimize based on certain rules. Our optimization strategy for IIS is based on YSlow.
Use the YSlow Firefox to open the target site, then click the YSlow icon and click Configured.
Where configured grade for YSlow rating your site, a (100 points) is the highest, F is the lowest, the following list of how to modify, I take IIS 6.0 as an example of how to optimize the performance of the site.
1, reduce the number of HTTP requests
This is mainly to modify the site code, reduce the number of external pictures, CSS, JS and other files, manually merge multiple css/javascript files. There is no setting for IIS.
2. Use CDN
For small sites, this is a free bar. Of course, rich people can try, can solve the problem that the user visits the website to be slow in the technology.
3. Enable Content Expiration
Enabling content expiration for static files can improve access performance. First, the site's directory to be divided into reasonable, pictures, CSS, JavaScript are placed in a separate directory, and then select the directory in IIS, point attribute HTTP header, enable content expiration, you can choose 30 days after the past, so that the user browser will compare the current date and due date, To decide whether to display cached pages or requests for updates from the server, because pictures, CSS, and JS usually have less change, so they are basically read from the local cache, which speeds up the display.
4. Enable gzip compression
HTTP compression is a way to transfer compressed text content between Web servers and browsers. HTTP compression uses a common compression algorithm such as gzip compression HTML, JavaScript, or CSS files. The biggest benefit of compression is that it reduces the amount of data transferred by the network, thereby increasing the access speed of the client browser.
Using the method, right-click the Web site-> properties and select Services. In the HTTP Compression box, select Compress static files, and the temporary directory recommends setting up a separate directory for the other disk.
Then, in IIS Manager, right-click the Web service Extensions-> "Add a new Web service extension", enter "Httpcompression" in "extension", and add "required files" as C:\WINDOWS\system32\inetsrv\ Gzip.dll, where the Windows system directory may vary depending on your installation, select Set extended status to allow.
Finally, the use of a text editor to open C:\Windows\System32\inetsrv\MetaBase.xml, in the hcfileextensions to add the need to compress the static file suffix name, the default is HTML and TXT file, the proposed add JS, CSS, etc., do not add pictures or zip, etc. have been compressed files.
5. Put the style file on the head
This is the basic HTML code style that puts all the CSS files on the head of the HTML page.
6, put the script file in the tail
This is also the basic HTML code style, where all JavaScript files are placed at the end of an HTML page.
7. Avoid CSS expressions
This is easy because most people never use CSS expressions.
8. Use external JavaScript and CSS
All JavaScript and CSS are referenced in the form of external files, mainly to allow these files to be cached by the browser, as described in the 3rd.
9, reduce DNS query
DNS query of the domain name will bring additional access overhead, reduce the number of host domain names within the page, and keep the host domain name of a page within 2-4, so that the loading speed of the page will not be reduced.
10. Compress JavaScript files
Compressed script files, delete unnecessary characters, can improve load time, there are many JavaScript file compression tools, I have a GUI interface js compression tool for download.
11. Avoid redirection
The redirection of a Web page can incur additional overhead, so avoid redirecting the page.
12. Delete duplicate scripts
A page containing the same JavaScript file two times can affect the performance of the load, so you need to delete the duplicate script files.
13. Configure ETag
This is a puzzling question. In theory, the etag deletion of the server will improve the performance of HTTP requests, but according to Microsoft's official modification method to configure IIS 6.0, there is no real effect, eventually I used a remetag, in the manner of ISAPI to achieve the deletion of the ETag function.
After the above web site front-end reconfiguration and Web server configuration changes, our page structure becomes more standardized, refactoring of the page will be achieved a good yslow score, overall performance has improved a lot. For the end user, it will also be obvious to visit the site speed of a lot faster, the site's browsing experience has been better promoted.