HTTP compression is used to compress contents from a Web server. Images used in the website are not in compressed format.
Statis HTML content contains only plain text and it is easy to compress.
There are mainly two types of compression
1)Gzip Compression:
Gzip Compression is used on files which contains dynamic data eg .aspx,.asp etc.
2)Static Compression:
Static compression is used on files such as .html,.htm,.txt,.doc which cannot be change frequently.
Follow below steps :
Statis HTML content contains only plain text and it is easy to compress.
There are mainly two types of compression
1)Gzip Compression:
Gzip Compression is used on files which contains dynamic data eg .aspx,.asp etc.
2)Static Compression:
Static compression is used on files such as .html,.htm,.txt,.doc which cannot be change frequently.
Follow below steps :
HTTP Compression in IIS 6
1. Enable web site compression in IIS.
a. Right-click the
web sites folder, then select the Service tab.
b. Activate the
compress application files checkbox.
c. Activate the
compress static files checkbox.
d. Limit the
maximum temporary directory size to the default value.
2. Add gzip.dll to Web Service
Extensions in IIS.
a. Left-click the
web service extensions folder.
b. In the right
pane, click the link to add a new web service extension.
c. Enter something
like “HttpCompression” for the extension name.
d. Click Add, then
browse to C:\Windows\System32\inetsrv.
e. Find and select
gzip.dll and click Open.
f. Activate the set
extension status to allowed checkbox and click OK.
3. Edit Metabase.xml file can be found
in the directory
C:\Windows\System32\Inetsrv\Metabase.xml
4. Edit below code to
<IIsCompressionScheme Location
="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="asp
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="0"
HcFileExtensions="htm
html
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="asp
dll
exe"
>
</IIsCompressionScheme>
In HcScriptFileExtensions add .aspx
file
In HcFileExtensions add .js and .css
5. Restart IIS
It's that easy to enable compression of Web pages, JavaScript, CSS . I hope you find this code as useful as I have.
It's that easy to enable compression of Web pages, JavaScript, CSS . I hope you find this code as useful as I have.