惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 李帅斌-Memory

快速导出CSV log4net使用详解 . C# 格式化字符串 web.config中特殊字符的转译 transactionscope的使用 一些概念需要明确的解释一下 还原已清空的回收站 安装卸载Windows服务 Jquery 文章积累 Spring.NET学习——控制反转(基础篇) SqlServer2005导出数据到SqlServer2000步骤! - 李帅斌-Memory - 博客园 MSSQL2005:SQL Server 2005安装图解 Asp.Net读取excel文件的时候 出错提示:外部表不是预期的格式 解决方案 js触发回车事件 - 李帅斌-Memory - 博客园 在Div中包含的元素移动时,触发div的onmouseout事件.解决方案! - 李帅斌-Memory - 博客园 VisualStudio用IE8调试时遇到的问题 JQuery+Ajax实现无刷新数据查询 Asp.net页面执行两遍Page_Load的解决方案 C#取硬盘序列号(-备忘-)
网站优化-Gzip压缩
李帅斌-Memory · 2009-10-26 · via 博客园 - 李帅斌-Memory

  新版站点开发完成了,最后一版的测试报告完成后,正式通知了董事长.

  第二天早上刚打开POPO,部门经理就发消息过来,说页面太大了,需要优化. 董事长通过fiddler看到里面包含了太多的Ajaxpro生成ashx文件,还有一个50几K的jquery文件.需要压缩.

  之前就听高手朋友说,GZIP是个好东东,在网上搜索了一些资料,实现了一把,果然,55K的jquery.min.js在fiddler里查看到,下载量只有18K.竟然压缩了37K.

  把实现的过程总结一下,记在这里,省得到时又要乱找资料.

  1、打开IIS,右击"网站"->"属性",选择"服务"。

    在Http压缩这项中,勾选中"压缩应用程序文件"与"压缩静态文件".确定.

  2、在Web服务扩展项右键,选择"添加一个新的Web服务扩展",添加文件,C:\WINDOWS\system32\inetsrv\gzip.dll

    选中设置扩展状态为允许。

  3、用文本编辑器打开C:\Windows\System32\inetsrv\MetaBase.xml(建议先备份),
    找到Location ="/LM/W3SVC/Filters/Compression/gzip用于设置gzip压缩,
    找到Location ="/LM/W3SVC/Filters/Compression/deflate"用于设置deflate压缩.
    <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> 

  4、保存文件时,会提示你,当前文件正在使用,不能修改,别急。

  5、打开windows服务,找到"IIS Admin Service",停止服务,会提示有两个服务依赖于该服务,一个是Http ssl,一个是World Wide Web Publishing Service,别怕,把这两个服务一起停止。

  6、保存修改的文件,这里应该能顺利保存。

  7、将刚才停止的三个服务Http ssl、World Wide Web Publishing Service、IIS Admin Service分别启动起来。

  8、重新启动IIS。

  9、OK,大功告成!

  10、打开fiddler,打开站点,从fiddler监视到的下载文件信息中,你会发现文件真的变小了。

  留下痕迹,以备不时之需。

  声明一下,参考这里做的。博主是个高手。http://www.cnblogs.com/zhangziqiu/archive/2009/05/17/gzip.html