Use the built-in compression function of IIS to increase website access speed

Source: Internet
Author: User
Tags metabase

HTTP compression isTransfer the compressed text content between the Web server and the browser.HTTP compression adopts common CompressionAlgorithmSuch as gzip to compress HTML, JavaScript, or CSS files. The biggest advantage of compression is that it reduces the amount of data transmitted over the network and increases the access speed of the client browser. Of course, it also adds a little load on the server. Gzip is a common HTTP compression algorithm.

The default IIS contains the gzip. dll component. You only need to enable the gzip. dll component. The procedure is as follows:

1. enable HTTP Compression

In IIS, right-click website Properties> service tab> select <zip ApplicationProgramFiles> <compressed static files> two options.

 

2. Add a new extension to the Web Service Extension

Right-click Web Service extension-> Add a new Web Service extension-> file C: \ windows \ system32 \ inetsrv \ gzip. dll-> set the extension status to allow.

 

3. Modify the IIS configuration file(Note: you must first back up the metabase. xml file)

1) Open the c: \ windows \ system32 \ inetsrv \ metabase. xml file.

2). use Ctrl + F to find location = "/lm/w3svc/filters/compression/gzip" and location = "/lm/w3svc/filters/compression/deflate"

3) modify the configuration of the two nodes to the following Configuration:

Code

  <  Iiscompressionscheme  Location  = "/Lm/w3svc/filters/compression/deflate"  
Hccompressiondll = "% WINDIR % \ system32 \ inetsrv \ gzip. dll"
Hccreateflags = "0"
Hcdodynamiccompression = "True"
Hcdoondemandcompression = "True"
Hcdostaticcompression = "True"
Hcdynamiccompressionlevel = "9"
Hcfileextensions = "Htm
Html
Txt
JS
CSS
SWF
XML"
Hcondemandcomplevel = "9"
Hcpriority = "1"
Hcscriptfileextensions = "ASP
Aspx
DLL
EXE"
>
</ Iiscompressionscheme >
< Iiscompressionscheme Location = "/Lm/w3svc/filters/compression/gzip"
Hccompressiondll = "% WINDIR % \ system32 \ inetsrv \ gzip. dll"
Hccreateflags = "1"
Hcdodynamiccompression = "True"
Hcdoondemandcompression = "True"
Hcdostaticcompression = "True"
Hcdynamiccompressionlevel = "9"
Hcfileextensions = "Htm
Html
Txt
JS
CSS
SWF
XML"
Hcondemandcomplevel = "9"
Hcpriority = "1"
Hcscriptfileextensions = "ASP
Aspx
DLL
EXE"
>
</ Iiscompressionscheme >

WhereHcfileextensions is a suffix that requires static compression. You can also add files such as Doc and XSL.

WhileHcscriptfileextensions is the suffix of dynamic compression.

 

4. After modification, save the file and restart IIS. (If the file cannot be saved, it indicates that IIS is in use. You can disable IIS services first)

 

 

 

In addition, Gzip detection address: http://tool.chinaz.com/Gzips/

 

It can be seen that the blog Park has also been accelerated by gzip:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.