One module recommended by myself can also compress all resources requested by the aspx page and compression modules that support powerful custom functions, like HttpCompress6.0, you can customize the types of resources you want to compress and do not compress those types of resources. You can also define whether to compress the specified page or not to compress the specified page, in addition, the Cache Resource function and the powerful function of the specified compressed directory are enabled. In addition, there will be no BUG like HttpCompress6.0 that the axd file is invalid, this compression module can perfectly support various ajax frameworks !!
<Addname = "WebResourceCompression" type = "WebResourceCompression. webResourceCompressionModule "/> <addname =" PageCompressionModule "type =" Compression. pageCompressionModule, Compression. pageCompressionModule "/> <configSections> <sectionGroupname =" DCWeb "> <sectionname =" HttpCompress "type =" DC. web. httpCompress. configuration, DC. web. httpCompress "/> </sectionGroup> </configSections> <DCWeb> <HttpCompress compress IonType = "GZip"> <! -- Set whether to enable cachefiles and specify the cache directory. If this line of configuration is deleted, the default value is false (no cache is enabled) --> <CacheSettingscacheFiles = "true" path = "cache"/> <! -- Set jspath and csspath. If this line of configuration is deleted, the default value will be used --> <PathSettingsjsPath = "javascript" cssPath = "css"/> <! -- Configure the type of resources to be compressed. Here, only html is compressed, that is, only the aspx page and *. axd resources will be compressed, and other resources (slice, CSS, etc.) will not be compressed! For example, to compress a gif image, add <add mime = "image/gif"/>, add <add mime = "image/jpeg"/> --> <IncludedMimeTypes> <addmime = "text/html"/> </IncludedMimeTypes> <! -- Use <ExcludedMimeTypes> <add mime = "text/html"/> </ExcludedMimeTypes> to configure the types of resources that are not compressed. Note: ExcludedMimeTypes and IncludedMimeTypes only need to be configured, if ExcludeMimeTypes is configured as above, it indicates that other resources except html resources will be compressed --> <ExcludedPaths> <! -- Set the page path without compression. The default. aspx page in the nocompress directory is set below, but the compression function is not enabled for other pages. --> <addpath = "~ /NoCompress/Default. aspx "/> </ExcludedPaths> </HttpCompress> </DCWeb> <! -- The js. axd and css. axd must be enabled to allow javascript. and css compression -->
Usage: see the CompressionModule for actual use and performance testing!
Advantages: open source code, powerful custom functions, ability to compress a variety of resources, and perfect support for various ajax frameworks!
Disadvantage: complicated use. Only asp. net2.0 or later is supported!
To sum up, various compression modules can optimize pages. However, since the compression process occurs at one end of the server, enabling these compression will consume a little server resources, however, in general, the compression only occurs when the client accesses the page for the first time. Because the browser caches the page and resource relationships, the server resources will not be used for compression when the access is refreshed again, therefore, for developers who have a huge website page size, enabling the compression function is definitely worth some money. After all, the page size is smaller and loading will be faster!
Usage: see the CompressionModule for actual use and performance testing!
Advantages: open source code, powerful custom functions, ability to compress a variety of resources, and perfect support for various ajax frameworks!
Disadvantage: complicated use. Only asp. net2.0 or later is supported!
<Cachesetaskcachefiles = "true" path = "cache"/>
The cache directory must exist in the project. Otherwise, an error will occur. If the project does not want to add this directory, you only need to delete this configuration section!