IIS6开启gzip的步骤_第1页
IIS6开启gzip的步骤_第2页
IIS6开启gzip的步骤_第3页
IIS6开启gzip的步骤_第4页
IIS6开启gzip的步骤_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1. 说明描述如何启用IIS6的GZip压缩功能。2. IIS 6配置过程下面是一台服务器启用gzip的配置过程:2.1. 设置web扩展新建一个服务器扩展,添加文件是:c:windowssystem32inetsrvgzip.dll然后启用这个扩展。2.2. 配置压缩参数1. 打开CMD 2. Type cd C:InetPubadminscripts, and then press ENTER. 3. Type the following, and then press ENTER: CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression

2、/GZIP/HcScriptFileExtensions动态压缩文件扩展名 asp dll exe aspx CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions asp dll exe aspx CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcFileExtensions 静态压缩文件扩展名htm html txt js CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/

3、Compression/DEFLATE/HcFileExtensions htm html txt js CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel 压缩级别0-10,数值越大压缩比越大,9性价比最佳。9 CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel 9 CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Co

4、mpression/Parameters/HcDoDynamicCompression是否启用动态压缩 TRUE CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/Parameters/HcDoStaticCompression 是否启用静态压缩TRUE4. Type iisreset, and then press ENTER.注:通过Web Sites的属性页,可以完成W3Svc/Filters/Compression/Parameters/HcDoDynamicCompression和HcDoStaticCompression属性

5、的设置。需注意,静态压缩的目录IIS_WPG必须要有读写权限。3. 相关参考3.1. Part I:MSDNPSS ID Number: 322603Article Last Modified on 2/13/2003The information in this article applies to: Microsoft Internet Information Services 5.0 Microsoft ASP.NET (included with the .NET Framework) 1.0This article was previously published under Q32

6、2603IMPORTANT: This article contains information about editing the metabase. Before you edit the metabase, verify that you have a backup copy that you can restore if a problem occurs. For information about how to do this, see the Configuration Backup/Restore Help topic in Microsoft Management Consol

7、e (MMC). 3.1.1. IN THIS TASK SUMMARY o HTTP Compression o Edit the Metabase REFERENCES3.1.2. SUMMARYThis step-by-step article describes how to configure Internet Information Services (IIS) 5.0 to compress .aspx pages. To use .aspx pages, you must have the ASP.NET page framework installed. You add th

8、e compression functionality for .aspx files by editing the IIS metabase. back to the top 3.1.3. HTTP CompressionHTTP compression provides faster transmission time between compression-enabled browsers (Microsoft Internet Explorer 5.0 or later) and IIS. You can either compress static files alone, or b

9、oth static files and applications. If your network bandwidth is restricted, consider HTTP compression, at least for static files, unless your processor utilization is already extremely high. When IIS receives a request, it checks to see if the browser is compression-enabled. IIS then checks the file

10、 name extension to see if the requested file is a static file or contains dynamic content. If the file contains static content, IIS checks to see if the file has previously been requested and is already stored in a compressed format in the temporary compression directory. If the file is not stored i

11、n a compressed format, IIS sends the uncompressed file to the browser, and adds a compressed copy of the file to the temporary compression directory. If the file is stored in a compressed format, IIS sends the compressed file to the browser. No files are compressed until they have been requested one

12、 time by a browser. If the file contains dynamic content, IIS compresses the file as it is generated and sends the compressed file to the browser. No copy of the file is stored. The cost of compressing a static file is modest and is typically incurred only one time, because the file is then stored i

13、n the temporary compression directory. The cost of compressing dynamically generated files is a little higher, because they are not stored and must be regenerated with each request. The cost of expanding the file at the browser is minimal. Compressed files download faster, so are particularly benefi

14、cial to the performance of any browser that uses a network connection with restricted bandwidth (a modem, for example). back to the top 3.1.4. Edit the MetabaseWARNING: If you edit the metabase incorrectly, you can cause serious problems that may require you to reinstall any product that uses the me

15、tabase. Microsoft cannot guarantee that problems that result if you incorrectly edit the metabase can be solved. Edit the metabase at your own risk.NOTE: Always back up the metabase before you edit it.To enable IIS 5.0 to compress .aspx pages, follow these steps: 1. Open a command prompt. 2. Type ne

16、t stop iisadmin, and then press ENTER. 3. Type cd C:InetPubadminscripts, and then press ENTER. 4. Type the following, and then press ENTER: CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions asp dll exe aspx5. Type the following, and then press ENTER: CSCRIPT.EXE ADSUT

17、IL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions asp dll exe aspx6. Type net start w3svc, and then press ENTER.back to the top 3.1.5. REFERENCESFor more information about compression, see the IIS 5.0 online documentation at the following Microsoft Web site: back to the top Keyword

18、s: kbhowto kbHOWTOmaster KB322603 Technology: kbASPNet100 kbASPNetSearch kbASPsearch kbAudDeveloper kbiis500 kbiisSearch 3.2. Part II:配置参数3.2.1. 配置节W3Svc/Filters/Compression/GZIPW3Svc/Filters/Compression/DEFLATE对应GZIP和DEFLATE两种压缩算法的配置节。W3Svc/Filters/Compression/Parameters对应IIS是否启用压缩的配置节。3.2.2. 配置参数H

19、cCacheControlHeader HcCompressionBufferSize HcCompressionDirectory HcCompressionDll HcCreateFlags HcDoDiskSpaceLimiting HcDoDynamicCompression HcDoOnDemandCompression HcDoStaticCompression HcDynamicCompressionLevel HcExpiresHeader HcFileExtensions HcFilesDeletedPerDiskFree HcIoBufferSize HcMaxDiskSp

20、aceUsage HcMaxQueueLength HcMimeType IIS 5.1 and later: This property is not available.HcMinFileSizeForComp HcNoCompressionForHttp10 HcNoCompressionForProxies HcNoCompressionForRange HcOnDemandCompLevel HcPriority HcScriptFileExtensions HcSendCacheHeaders HeaderWaitTimeout IIS 5.1 and earlier: This

21、property is not available.HistoryExpiration IIS 5.0 and earlier: This property is not available.HistoryMajorVersionNumber IIS 5.1 and earlier: This property is not available.HistoryTableFile IIS 5.0 and earlier: This property is not available.HonorClientMsgIds IIS 5.0 and earlier: This property is n

22、ot available.HopCount IIS 5.0 and earlier: This property is not available.HttpCustomHeaders HttpErrors HttpExpires HttpPics HttpRedirect 3.3. Part II:IIS6 开启gzip的步骤(Internet)IIS6开启gzip的步骤 2007-11-19 12:40:00 | By: YuTian930 启用IIS的Gzip压缩功能启用IIS的Gzip压缩功能现代的浏览器IE6和Firefox都支持客户端Gzip,也就是说,在服务器上的网页,传输之前,先

23、使用Gzip压缩再传输给客户端,客户端接收之后由浏览器解压显示,这样虽然稍微占用了一些服务器和客户端的CPU,但是换来的是更高的带宽利用率。对于纯文本来讲,压缩率是相当可观的。如果每个用户节约50%的带宽,那么你租用来的那点带宽就可以服务多一倍的客户了。IIS6已经内建了Gzip压缩的支持,可惜,没有设置更好的管理界面。所以要打开这个选项,还要费些功夫。首先,如果你需要压缩静态文件(HTML),需要在硬盘上建一个目录,并给它“IUSR_机器名”这个用户的写权限。如果压缩动态文件(PHP,asp,aspx)就不需要了,因为它的页面是每次都动态生成的,压缩完就放弃。然后在IIS管理器中,“网站”上

24、面右键属性,不是下面的某个站点,而是整个网站。进入“服务”标签,选上启用动态内容压缩,静态内容压缩。然后选中网站下面那个服务器扩展,新建一个服务器扩展。名字无所谓,下面的添加文件的路径是:c:windowssystem32inetsrvgzip.dll,然后启用这个扩展。这时候静态内容是可以压缩的,但是对于动态内容,aspx文件却不在压缩范围内。因为默认的可压缩文件并没有这个扩展名。而管理界面中你又找不到可以增加扩展名的地方,这时候只能去修改它的配置文件了。在c:windowssystem32inetsrv下面有个MetaBase.xml文件,可以用记事本打开,找到IIsCompressionScheme,有

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论