Gzip compression uses a compression algorithm that compresses the content of the Web page, reducing the page size. The use of GIZP compression reduces the bandwidth of the server and improves the speed of Web page opening. Look underneath, I found one. The gzip compression scheme is enabled in ASP.
First, we need to download DC.Web.HttpCompress.dll and reference it to our ASP. Next in the Web. config simple configuration, you can achieve gzip compression, need to configure the following places:
<sectiongroup name="dcweb"> <section name="httpcompress " type="DC. WEB.HTTPCOMPRESS.CONFIGURATION,DC. Web.httpcompress"/> </sectionGroup></configSections>
<!--configuring gzip compression--><dcweb> "GZip"> <!--set Jspath and Csspath, if you delete this line of configuration, you will use the default value--<pathsettings jspath="JavaScript"Csspath="CSS"/> <IncludedMimeTypes> <add mime="text/html"/> <add mime="Image/gif"/> <add mime="Image/jpeg"/> <add mime="Text/css"/> <add mime="Application/x-javascript"/> </IncludedMimeTypes> <!--To configure what type of resource is not compressed, use:<ExcludedMimeTypes> <add mime="text/html"/> </ExcludedMimeTypes>Note: Excludedmimetypes and includedmimetypes only need to be configured one, if you configure Excludemimetypes as above, it means that other resources are compressed except the HTML type.-<!--<ExcludedPaths>set a page path that does not have compression enabled, and the Default.aspx page under the Nocompress directory will not have compression enabled, but other pages would normally have compression enabled<add path="~/nocompress/default.aspx"/> </ExcludedPaths>--> </HttpCompress></DCWeb><!--gzip compression ended-
<add name= "Httpcompressmodule" type= "DC. WEB.HTTPCOMPRESS.HTTPMODULE,DC. Web.httpcompress "/>
</system.web>
Here we have implemented the ASP. NET gzip compression, below look at my local test results, you can use Google Chrome browser to see if gzip compression is enabled, use Ctrl+shift+j to open, click Resources to view files, as follows:
Before you enable gzip compression
After gzip compression is enabled
ASP. NET GZIP compression enabled