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: