{"id":112,"date":"2009-11-06T07:45:02","date_gmt":"2009-11-06T07:45:02","guid":{"rendered":"http:\/\/samwebman.wordpress.com\/?p=112"},"modified":"2009-11-06T07:45:02","modified_gmt":"2009-11-06T07:45:02","slug":"%e6%87%89%e7%94%a8-iis-6-0-%e7%9a%84-gzip-%e5%a3%93%e7%b8%ae%e5%8a%9f%e8%83%bd%e9%99%8d%e4%bd%8e%e7%b6%b2%e8%b7%af%e5%82%b3%e8%bc%b8%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.intentrust.com\/?p=112","title":{"rendered":"\u61c9\u7528 IIS 6.0 \u7684 Gzip \u58d3\u7e2e\u529f\u80fd\u964d\u4f4e\u7db2\u8def\u50b3\u8f38\u91cf"},"content":{"rendered":"<blockquote><p>\u751f\u5b58\u5728\u8cc7\u8a0a\u7206\u70b8\u7684\u7db2\u9801\u7a0b\u5f0f\u8a2d\u8a08\u5e2b\u5011\u61c9\u8a72\u90fd\u6703\u9047\u5230\u7db2\u7ad9\u6548\u80fd\u4e0d\u4f73\u7684\u554f\u984c\uff0c\u7136\u800c\u7db2\u7ad9\u6548\u80fd\u4e0d\u4f73\u6709\u591a\u7a2e\u539f\u56e0\uff0c\u8209\u51e1 Web Server \u672c\u8eab\u7684\u6548\u80fd\u554f\u984c\u3001\u7cfb\u7d71\u67b6\u69cb\u8a2d\u8a08\u4e0d\u826f\u3001\u5f8c\u7aef\u8cc7\u6599\u5eab\u8ca0\u8f09\u904e\u91cd\u53ca\u8a2d\u8a08\u4e0d\u826f\uff0cWeb Server \u5c07\u7db2\u9801\u5167\u5bb9\u50b3\u8f38\u5230\u4f7f\u7528\u8005\u700f\u89bd\u5668\u7684\u7db2\u8def\u50b3\u8f38\u554f\u984c\u7b49\u7b49\uff0c\u9019\u4e9b\u90fd\u662f\u9700\u8981\u9762\u5c0d\u7684\u554f\u984c\uff0c\u7db2\u8def\u50b3\u8f38\u554f\u984c\u6700\u7c21\u55ae\u4e5f\u6700\u5bb9\u6613\u89e3\u6c7a\u7684\u5c31\u662f\u964d\u4f4eWeb Server\u50b3\u8f38\u5230\u4f7f\u7528\u8005\u700f\u89bd\u5668\u7684\u7db2\u9801\u5167\u5bb9\u5927\u5c0f\uff0c\u964d\u4f4e\u7db2\u9801\u5167\u5bb9\u5927\u5c0f\u4e5f\u6709\u591a\u7a2e\u65b9\u6cd5\uff0c\u4f8b\u5982\u628aHTML\u6a94\u6848\u7684\u63db\u884c\u53ca\u4e0d\u5fc5\u8981\u7684\u7a7a\u767d\u5b57\u5143\u79fb\u9664\uff0cCSS \u76e1\u91cf\u8a2d\u8a08\u5171\u7528\u67b6\u69cb\u4e0d\u8981\u4f7f\u7528 Inline\uff0c\u58d3\u7e2e Javascript \u6a94\u6848\uff0c\u7e2e\u5c0f\u5f15\u7528\u7684\u5716\u6a94\u7b49\uff0c\u9084\u6709\u4e00\u500b\u5927\u90e8\u5206 Web Server \u5982: WebSphere\u3001APACHE\u3001IIS 5.0 \u4ee5\u4e0a\u90fd\u652f\u63f4\u7684 GZIP HTTP \u58d3\u7e2e\u529f\u80fd\uff0c\u4e0d\u904e\u4f60\u7528\u58d3\u7e2e\u529f\u80fd\u4e00\u5b9a\u8981\u72a7\u7272\u4e00\u4e9b CPU Time \uff0c\u76ee\u524d\u5927\u90e8\u5206\u5165\u53e3\u7db2\u7ad9\u4e5f\u90fd\u4f7f\u7528\u6b64\u9805\u529f\u80fd\u4f86\u6e1b\u5c11\u983b\u5bec\u7684\u4f7f\u7528\u7387\uff0c\u6709\u6548\u7684\u63d0\u9ad8\u7db2\u9801\u700f\u89bd\u7684\u901f\u5ea6\uff0c\u6211\u7684 E \u653f\u5e9c (www.gov.tw)\u3001Yahoo(tw.yahoo.com) \u7b49\u5927\u578b\u5165\u53e3\u7db2\u7ad9\u4e5f\u90fd\u6709\u4f7f\u7528 GZIP\uff0c\u9019\u4e5f\u8aaa\u660e\u4e86\u4ed6\u662f\u500b\u5f88\u666e\u904d\u7684\u6280\u8853\uff0c\u5982\u679c\u60f3\u63d0\u5347\u700f\u89bd\u901f\u5ea6\u7684\u8a71\uff0c\u4e0d\u59a8\u76e1\u5feb\u8a55\u4f30\u5c0e\u5165\u6b64\u529f\u80fd\u3002<\/p>\n<p>\u6211\u5011\u53ef\u4ee5\u4f7f\u7528 HttpWatch \u5de5\u5177\u4f86\u8b49\u660e\u4e0a\u8ff0\u7684\u7db2\u7ad9\u4f7f\u7528\u4e86 Gzip \u58d3\u7e2e\u6280\u8853\uff0c\u5de6\u908a\u8996\u7a97\u7684 Accept-Encoding \u5c6c\u6027\u8868\u793a\u700f\u89bd\u5668\u6709\u652f\u63f4 Gzip\uff0c\u53f3\u908a\u8996\u7a97\u7684 Content-Encoding \u5247\u8868\u793a\u76ee\u524d\u7684\u7db2\u9801\u5167\u5bb9\u6709\u4f7f\u7528 Gzip \u58d3\u7e2e :<\/p>\n<p>1. \u6211\u7684E\u653f\u5e9c www.gov.tw<\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image002_2.jpg\"><img loading=\"lazy\" title=\"clip_image002\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image002_thumb.jpg\" border=\"0\" alt=\"clip_image002\" width=\"644\" height=\"262\" \/><\/a><\/p>\n<p>2. \u53f0\u7063\u96c5\u864e\u5947\u6469 tw.yahoo.com<\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image004_2.jpg\"><img loading=\"lazy\" title=\"clip_image004\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image004_thumb.jpg\" border=\"0\" alt=\"clip_image004\" width=\"644\" height=\"246\" \/><\/a><\/p>\n<p>3. \u9ede\u90e8\u843d(\u5c1a\u672a\u4f7f\u7528\u4efb\u4f55\u58d3\u7e2e\uff0c\u56e0\u6b64\u7121Content-Encoding\u5c6c\u6027)<\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image006_2.jpg\"><img loading=\"lazy\" title=\"clip_image006\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image006_thumb.jpg\" border=\"0\" alt=\"clip_image006\" width=\"644\" height=\"216\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u6211\u5011\u73fe\u5728\u5c31\u4f86\u4e86\u89e3\u4e00\u4e0b\u5982\u4f55\u5728 IIS 6.0 \u4e0a\u8a2d\u5b9a Gzip\uff0c\u4f86\u58d3\u7e2e\u975c\u614b\u6a94\u6848\u53ca\u52d5\u614b\u6a94\u6848\uff0c\u9019\u88e1\u7684\u6b65\u9a5f\u61c9\u8a72\u6709\u4e0d\u5c11\u7684 Blog \u6587\u7ae0\u8aaa\u660e\uff0c\u4e0d\u904e\u6211\u9084\u662f\u81ea\u5df1\u505a\u500b\u7d00\u9304\uff0c\u4ee5\u5f8c\u5c31\u4e0d\u9700\u8981\u5230\u8655\u53bb\u627e\u8cc7\u6599\u4e86\u3002<\/p>\n<p><strong> 1. \u958b\u555f\u7db2\u969b\u7db2\u8def\u8cc7\u8a0a\u670d\u52d9(IIS)\u7ba1\u7406\u54e1\uff0c\u4e26\u52fe\u9078\u555f\u7528\u76f4\u63a5 Metabase \u7de8\u8f2f\uff0c\u5982\u6b64\u5c31\u53ef\u4ee5\u5728\u4fee\u6539 IIS Metabase \u6a94\u8a2d\u5b9a\u5f8c\uff0c\u5404\u7db2\u7ad9\u4fbf\u7acb\u5373\u751f\u6548\uff0c\u4e0d\u7136\u5c31\u5f97\u5728\u8a2d\u5b9a\u5f8c\u57f7\u884c IISReset \u9019\u662f Production \u6b63\u5f0f\u6a5f\u6240\u4e0d\u5141\u8a31\u7684\u3002<\/strong><\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image008_2.jpg\"><img loading=\"lazy\" title=\"clip_image008\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image008_thumb.jpg\" border=\"0\" alt=\"clip_image008\" width=\"290\" height=\"221\" \/><\/a> <a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image010_2.jpg\"><img loading=\"lazy\" title=\"clip_image010\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/clip_image010_thumb.jpg\" border=\"0\" alt=\"clip_image010\" width=\"301\" height=\"310\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2. \u65bc IIS \u7ba1\u7406\u54e1\u9078\u64c7\u300c\u7db2\u7ad9\u300d\u3001\u300c\u5167\u5bb9\u300d\u3001\u300c\u670d\u52d9\u300d\u9801\u7c64\uff0c\u52fe\u9078\u300c\u58d3\u7e2e\u61c9\u7528\u7a0b\u5f0f\u6a94\u6848\u300d\u3001\u300c\u58d3\u7e2e\u975c\u614b\u6a94\u6848\u300d\uff0c\u66ab\u5b58\u76ee\u9304\u7684\u5927\u5c0f\u9650\u5236\u53ef\u4f9d\u9700\u6c42\u505a\u8a2d\u5b9a\uff0c\u4e00\u822c\u4e0d\u5efa\u8b70\u9650\u5236\uff0c\u4e0d\u7136\u8cc7\u6599\u593e\u7684\u4f7f\u7528\u7a7a\u9593\u53ef\u662f\u9700\u8981\u96a8\u6642\u6ce8\u610f\u624d\u884c\u3002<\/strong><\/p>\n<p>\u300c<strong>\u58d3\u7e2e\u61c9\u7528\u7a0b\u5f0f\u6a94\u6848<\/strong>\u300d\uff0d <span style=\"color:#000080;\">\u5c31 \u662f\u958b\u555f IIS Server \u7aef\u52d5\u614b\u7db2\u9801\u7684\u5373\u6642\u58d3\u7e2e\u7db2\u9801\u8cc7\u6599\u5167\u5bb9\uff0c\u4f8b\u5982 : .asp\u3001.aspx\u3001.php\u3001.jsp \u7b49\uff0cIIS Server \u4e26\u4e0d\u6703\u5132\u5b58\u9019\u4e9b\u52d5\u614b\u6a94\u6240\u7522\u751f\u7684\u7db2\u9801\u5167\u5bb9\u7684\u58d3\u7e2e\u526f\u672c\uff0c\u800c\u662f\u5373\u6642\u58d3\u7e2e\u5f8c\u5c07\u5167\u5bb9\u50b3\u9001\u7d66\u700f\u89bd\u5668\uff0c\u6240\u4ee5\u4ed6 \u6bd4\u8f03\u8017 CPU Time \u3002<\/span><\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_22.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_10.png\" border=\"0\" alt=\"image\" width=\"644\" height=\"215\" \/><\/a><\/p>\n<p>\u300c<strong>\u58d3\u7e2e\u975c\u614b\u6a94\u6848<\/strong>\u300d\uff0d<span style=\"color:#000080;\"> IIS Server \u6703\u5148\u6aa2\u67e5\u975c\u614b\u6a94\u6848\u66ab\u5b58\u76ee\u9304\u4e0b\uff0c\u662f\u5426\u76ee\u524d\u7684 Request \u6a94\u7684\u58d3\u7e2e\u6a94\u6848\uff0c\u4e26\u6aa2\u67e5\u539f\u6a94\u662f\u5426\u5df2\u88ab\u4fee\u6539\u904e\uff0c\u82e5\u4fee\u6539\u904e\u5247\u6703\u91cd\u65b0\u58d3\u7e2e\u8a72\u6a94\uff0c\u7136\u5f8c\u5c07\u58d3\u7e2e\u7684\u6a94\u6848\u5167\u5bb9\u56de\u50b3\u7d66\u700f\u89bd\u5668\uff0c<\/span><span style=\"color:#000080;\">\u975c\u614b\u6a94\u5982: .htm\u3001.html\u3001.cs\u3001.js \u7b49\u3002<\/span><\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_24.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_11.png\" border=\"0\" alt=\"image\" width=\"644\" height=\"315\" \/><\/a><\/p>\n<p><span style=\"color:#0000ff;\"><strong>\u5176\u5be6 IIS Server\u5728\u50b3\u9001\u7d66\u700f\u89bd\u5668\u6642\uff0c\u90fd\u6703\u5148\u6aa2\u67e5\u700f\u89bd\u5668\u662f\u5426\u652f\u63f4 GZip \u58d3\u7e2e\u529f\u80fd\uff0c\u4e0d\u7136 IIS Server \u5982\u679c\u50b3\u9001\u5df2\u58d3\u7e2e\u904e\u7684\u7db2\u9801\u5167\u5bb9\u7d66\u700f\u89bd\u5668\u6642\uff0c\u700f\u89bd\u5668\u4e0d\u652f\u63f4 Gzip \u7684\u8a71\uff0c\u5c07\u7121\u6cd5\u6b63\u5e38\u986f\u793a\u7db2\u9801\u8cc7\u6599\u7d66\u4f7f\u7528\u8005\u700f\u89bd\u3002<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_2.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb.png\" border=\"0\" alt=\"image\" width=\"359\" height=\"230\" \/><\/a> <a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_4.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_1.png\" border=\"0\" alt=\"image\" width=\"644\" height=\"377\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>3.\u65b0\u589e\u4e00\u500b\u7db2\u9801\u670d\u52d9\u5ef6\u4f38\uff0c\u9019\u88e1\u4fbf\u662f\u4ee5\u4eba\u5de5\u65b9\u5f0f\u4f86\u64f4\u5145 IIS \u7684 ISAPI\u3002<\/strong><\/p>\n<p>\u4f60\u5fc5\u9808\u7559\u610f\u5230 ISAPI Extension \u3001ISAPI Filter \u662f\u4e0d\u540c\u7684\u67b6\u69cb\uff0c\u4e0d\u904e\u4ed6\u5011\u7684\u76ee\u7684\u90fd\u662f\u70ba\u4e86\u64f4\u5145 IIS \u7684\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u53c3\u8003 <a href=\"http:\/\/www.goodman-lai.idv.tw\/2005\/06\/iis-60.html\" target=\"_blank\" rel=\"noopener\">IIS 6.0 \u7684\u61c9\u7528\u7a0b\u5f0f\u57f7\u884c\u6a21\u5f0f<\/a> \u6703\u6709\u4e00\u4e9b\u8aaa\u660e\u3002<\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_6.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_2.png\" border=\"0\" alt=\"image\" width=\"746\" height=\"292\" \/><\/a> <a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_8.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_3.png\" border=\"0\" alt=\"image\" width=\"407\" height=\"321\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>4.\u63a5\u4e0b\u4f86\u662f IIS metabase \u6a94\u7684\u8a2d\u5b9a\uff0c\u6b64\u6a94\u6848\u662f\u4ee5 XML \u683c\u5f0f\u5132\u5b58\u7684\uff0c\u9019\u662f\u6700\u91cd\u8981\u7684\u6b65\u9a5f\uff0c\u4e14\u5fc5\u9808\u5c0f\u5fc3\u6bcf\u500b\u8a2d\u5b9a\u7684\u5c6c\u6027\u503c\uff0c\u4e0d\u7136\u6703\u767c\u751f\u56b4\u91cd\u7684\u7cfb\u7d71\u932f\u8aa4\uff0c\u5efa\u8b70\u8a2d\u5b9a\u524d\u5148\u5099\u4efd\u8a72\u6a94\u6848\u3002<\/strong><\/p>\n<p>\u6a94\u6848\u7684\u8def\u5f91\u9810\u8a2d\u662f\u5728 C:\\Windows\\System32\\inetsrv\\MetaBase.xml \uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u7684\u6587\u5b57\u7de8\u8f2f\u5668\u4f86\u4fee\u6539\u6b64\u6a94\u6848\u7684 &lt;IIsCompressionScheme \/&gt; \uff0c\u4e0d\u904e\u6211\u5efa\u8b70\u53ef\u4ee5\u4f7f\u7528 <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&amp;DisplayLang=en\" target=\"_blank\" rel=\"noopener\">IIS Metabase Explorer<\/a> \u5de5\u5177(IIS 6.0 Resource Kit Tools)\u4f86\u5354\u52a9\u7de8\u8f2f\uff0c \u9019\u6a23\u6bd4\u8f03\u4e0d\u5bb9\u6613\u51fa\u932f\u3002<\/p>\n<p>\u5728\u6b64\u4f60\u6703\u767c\u73fe\u6211\u5011\u7de8\u8f2f\u4e86\u5169\u500b &lt;IIsCompressionScheme \/&gt; \u4e0d\u904e\u4ed6\u5011\u662f\u5c6c\u65bc\u4e0d\u540c\u7684 HTTP \u58d3\u7e2e\u6f14\u7b97\u6cd5\uff0c\u4e00\u500b\u662f Deflate\uff0c\u4e00\u500b\u662f Gzip\uff0c\u6211\u5011\u5c31\u9806\u4fbf\u8a2d\u5b9a\u9019\u5169\u500b\uff0c\u56e0\u70ba\u4ed6\u5011\u53ea\u662f\u58d3\u7e2e\u6f14\u7b97\u6cd5\u4e0d\u540c\u800c\u5df2\u3002<\/p>\n<pre>\n<pre>&lt;IIsCompressionScheme\tLocation =\"\/LM\/W3SVC\/Filters\/Compression\/deflate\"\n\t\tHcCompressionDll=\"%windir%\\system32\\inetsrv\\gzip.dll\"\n\t\tHcCreateFlags=\"0\"\n\t\tHcDoDynamicCompression=\"TRUE\"\n\t\tHcDoOnDemandCompression=\"TRUE\"\n\t\tHcDoStaticCompression=\"FALSE\"\n\t\tHcDynamicCompressionLevel=\"9\"\n\t\tHcFileExtensions=\"htm\n\t\t\thtml\n\t\t\ttxt\n\t\t\tjs\n\t\t\tcss\n\t\t\tdoc\n\t\t\ttxt\n\t\t\tptt\n\t\t\txls\n\t\t\thtc\"\n\t\tHcOnDemandCompLevel=\"10\"\n\t\tHcPriority=\"1\"\n\t\tHcScriptFileExtensions=\"asp\n\t\t\texe\n\t\t\taspx\n\t\t\tasmx\n\t\t\tdll\"\n\t&gt;\n&lt;\/IIsCompressionScheme&gt;\n&lt;IIsCompressionScheme\tLocation =\"\/LM\/W3SVC\/Filters\/Compression\/gzip\"\n\t\tHcCompressionDll=\"%windir%\\system32\\inetsrv\\gzip.dll\"\n\t\tHcCreateFlags=\"1\"\n\t\tHcDoDynamicCompression=\"TRUE\"\n\t\tHcDoOnDemandCompression=\"TRUE\"\n\t\tHcDoStaticCompression=\"TRUE\"\n\t\tHcDynamicCompressionLevel=\"9\"\n\t\tHcFileExtensions=\"htm\n\t\t\thtml\n\t\t\ttxt\n\t\t\tjs\n\t\t\tcss\n\t\t\thtc\n\t\t\tdoc\n\t\t\tptt\n\t\t\txls\"\n\t\tHcOnDemandCompLevel=\"10\"\n\t\tHcPriority=\"1\"\n\t\tHcScriptFileExtensions=\"asp\n\t\t\texe\n\t\t\taspx\n\t\t\tasmx\n\t\t\tdll\"\n\t&gt;\n&lt;\/IIsCompressionScheme&gt;<\/pre>\n<p><span style=\"color:#0000ff;\"><strong>\u9019\u88e1\u63d0\u9192\u4f60\u7684\u662f : \u5982\u679c\u4f60\u7684\u7db2\u7ad9\u4f7f\u7528\u4e86 ASP.NET AJAX \u7684\u8a71\uff0c\u5efa\u8b70\u4f60\u4e0d\u8981\u58d3\u7e2e .axd \u6a94\u6848\uff0c\u4e0d\u7136\u7db2\u9801\u5f88\u5bb9\u6613\u767c\u751f\u932f\u8aa4\uff0c\u56e0\u70ba\uff0c\u700f\u89bd\u5668\u4e0d\u898b\u5f97\u652f\u63f4\u89e3\u58d3\u7e2e .axd\uff0c\u6240\u4ee5\u4f60\u5fc5\u9808\u505a\u53d6\u6368\u7684\uff0c<\/strong><\/span><span style=\"color:#0000ff;\"><strong>\u4e0d \u904e\uff0c\u4f60\u53ef\u4ee5\u5728 ScriptManager \u6216 ToolkitScriptManager \u63a7\u5236\u9805\u8a2d\u5b9a ScriptMode=&#8221;Release&#8221; \u6216 ScriptMode=&#8221;Auto&#8221;(\u9810\u8a2d\u503c) \u642d\u914d Web.config \u7684 &lt;system.web&gt;&lt;compilation debug=&#8221;false&#8221; defaultLanguage=&#8221;c#&#8221; \/&gt;&lt;\/system.web&gt; <\/strong><\/span><span style=\"color:#0000ff;\"><strong>\u8a2d\u5b9a\uff0c<\/strong><\/span><span style=\"color:#0000ff;\"><strong>\u4f9d\u7d93\u9a57\u4e5f\u53ef\u4ee5\u9054\u5230 ASP.NET AJAX \u4e00\u4e9b\u6a94\u6848\u7684\u58d3\u7e2e\u6548\u679c\u3002\u5982\u679c\u771f\u7684\u8981\u58d3\u7e2e\u7db2\u7ad9\u7684 .axd \u6a94\uff0c\u5efa\u8b70\u8981\u505a\u7db2\u7ad9\u529f\u80fd\u7684\u56de\u6b78\u6e2c\u8a66\u3002&lt;\u53c3\u8003:<a href=\"http:\/\/www.dotblogs.com.tw\/yilinliu\/archive\/2008\/11\/04\/5866.aspx\" target=\"_blank\" rel=\"noopener\">\u7e2e\u6e1bAJAX\u7684axd\u5167\u5bb9\u5927\u5c0f<\/a>&gt;<\/strong><\/span><\/p>\n<p>Update 2009\/02\/11 : \u4f7f\u7528 HttpWatch \u91dd\u5c0d ASP.NET AJAX \u7684 WebResource.axd \u53ca ScriptResource.axd \u5074\u9304\u5f8c\u767c\u73fe\uff0c\u5176\u5be6\u4f9d\u7167\u4e0a\u8ff0\u7684\u8a2d\u5b9a\u5f8c\uff0c\u6703\u7531 AJAX \u7684 HttpHandler \u81ea\u52d5\u4ee5 GZIP \u58d3\u7e2e\u4e0a\u8ff0\u5169\u500b .axd \uff0c\u96d6\u7136\u4f60\u7684\u7db2\u7ad9\u53ef\u80fd\u4e0d\u53ea\u9019\u5169\u500b .axd \u6a94\uff0c\u4f46\u70ba\u4e86\u907f\u514d\u767c\u751f\u4e0d\u53ef\u9810\u671f\u7684\u554f\u984c\uff0c\u6240\u4ee5\uff0c\u5efa\u8b70\u76e1\u91cf\u907f\u514d\u5728 IIS \u4e0a\u53c8\u958b\u555f .axd \u6a94\u58d3\u7e2e\u3002<\/p>\n<p><strong>\u4f7f\u7528 IIS Metabase Explorer \u7de8\u8f2f :<\/strong><\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_10.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_4.png\" border=\"0\" alt=\"image\" width=\"898\" height=\"416\" \/><\/a><\/p>\n<p>\u6211\u5011\u8b8a\u66f4\u4e86\u4e09\u500b\u8a2d\u5b9a\uff0c\u82e5\u6709\u9700\u8981\u7684\u8a71\u8acb\u81ea\u884c\u4fee\u6539\u5176\u4ed6\u5c6c\u6027\u503c\u8a2d\u5b9a\u3002<\/p>\n<ul>\n<li>HcFileExtensions\uff0dhtm, html, txt , js, cs, htc, doc, ptt, xls<\/li>\n<li>HcDynamicCompressionLevel\uff0d9 (\u503c\u8d8a\u5927\u58d3\u7e2e\u6548\u679c\u8d8a\u597d\uff0c\u4f46\u8d8a\u8017 CPU Time)<\/li>\n<li>HcScriptFileExtensions\uff0dasp, exe, aspx, asmx, dll<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>4. \u8a2d\u5b9a\u5b8c\u7562\u5f8c\u9808\u505a\u7db2\u7ad9\u7684\u529f\u80fd\u56de\u6b78\u6e2c\u8a66\u4ee5\u78ba\u4fdd\u6240\u6709\u529f\u80fd\u5747\u6b63\u5e38\u904b\u4f5c\uff0c\u82e5\u767c\u73fe\u6709\u5728\u540c\u4e00\u53f0 IIS Server \u4e0a\u6709\u7db2\u7ad9\u4e0d\u80fd\u4f7f\u7528 Gzip \u58d3\u7e2e\u7684\u8a71\uff0c\u4e5f\u53ef\u55ae\u7368\u6392\u9664\u8a72\u7db2\u7ad9\u4e0d\u9032\u884c\u58d3\u7e2e\u3002<\/strong><\/p>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_14.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_6.png\" border=\"0\" alt=\"image\" width=\"876\" height=\"238\" \/><\/a><\/p>\n<p>\u8981\u95dc\u9589\u8b58\u5225\u5143\u70ba 132465789 \u7db2\u7ad9\u7684\u975c\u614b\u58d3\u7e2e\u529f\u80fd\u9019\u908a\u63d0\u4f9b\u5169\u7a2e\u65b9\u6cd5\uff0c\u53e6\u5916\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539 Metabase.xml \u6a94:<\/p>\n<ul>\n<li>\u4f60\u53ef\u4ee5\u4f7f\u7528\u6307\u4ee4\u65b9\u5f0f\u8a2d\u5b9a\u8a72\u7db2\u7ad9\u7684 DoStaticCompression \u5c6c\u6027\u70ba 0 (False)\uff0cUsertype\u5c6c\u6027\u70ba file \u3002<\/li>\n<\/ul>\n<p>cscript C:\\Inetpub\\AdminScripts\\adsutil.vbs set w3svc\/123465789\/root\/DoStaticCompression False<\/p>\n<ul>\n<li>\u4f7f\u7528 IIS Metabase Expolorer \u4f86\u65b0\u589e\u4e00\u500b DoStaticCompression\u00a0 DWORD<\/li>\n<\/ul>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_16.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_7.png\" border=\"0\" alt=\"image\" width=\"468\" height=\"484\" \/><\/a> <a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_18.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6GZIP_9E95\/image_thumb_8.png\" border=\"0\" alt=\"image\" width=\"410\" height=\"268\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u8981\u95dc\u9589\u8b58\u5225\u5143\u70ba 132465789 \u7db2\u7ad9\u7684\u52d5\u614b\u58d3\u7e2e\u529f\u80fd\u9019\u908a\u63d0\u4f9b\u5169\u7a2e\u65b9\u6cd5\uff0c\u53e6\u5916\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539 Metabase.xml \u6a94:<\/p>\n<ul>\n<li>\u4f60\u53ef\u4ee5\u4f7f\u7528\u6307\u4ee4\u65b9\u5f0f\u8a2d\u5b9a\u8a72\u7db2\u7ad9\u7684 DoDynamicCompression \u5c6c\u6027\u70ba 0 (False)\uff0cUsertype\u5c6c\u6027\u70ba file \u3002<\/li>\n<\/ul>\n<p>cscript C:\\Inetpub\\AdminScripts\\adsutil.vbs set w3svc\/123456789\/root\/DoDynamicCompression False<\/p>\n<ul>\n<li>\u4f7f\u7528 IIS Metabase Expolorer \u4f86\u65b0\u589e\u4e00\u500b DoDynamicCompression DWORD<\/li>\n<\/ul>\n<p><a href=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6.0Gzip_13D59\/image_2.png\"><img loading=\"lazy\" title=\"image\" src=\"http:\/\/files.dotblogs.com.tw\/jameswu\/0901\/IIS6.0Gzip_13D59\/image_thumb.png\" border=\"0\" alt=\"image\" width=\"413\" height=\"273\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size:small;\">\u7e3d\u7d50<\/span><\/strong><\/p>\n<p><span style=\"font-size:x-small;\">\u6211\u8a66\u904e\u4e00\u4e9b\u71b1\u5fc3\u7db2\u53cb\u5206\u4eab\u6216\u662f Open Source \u7684\u61c9\u7528 GZIP \u7684 ASP.NET HTTPModule \u4f86\u58d3\u7e2e ASP.NET AJAX \u7db2\u7ad9\u7684\u7db2\u9801\u8cc7\u6599\u5167\u5bb9\uff0c<\/span><\/p>\n<p><span style=\"font-size:x-small;\">\u4f8b\u5982: Code Project \u7684 <a href=\"http:\/\/www.codeproject.com\/KB\/aspnet\/httpcompression.aspx\" target=\"_blank\" rel=\"noopener\">HTTP Compression Module<\/a> \u6b64\u529f\u80fd\u53ef\u58d3\u7e2e <em>WebResource.axd<\/em> \u6a94\uff0c\u4f46\u662f\uff0c\u5728 .NET Framework 3.5 \u7684 ASP.NET AJAX \u74b0\u5883\u6e2c\u8a66\u4f9d\u7136\u6709\u90e8\u5206\u7db2\u9801\u4f86\u662f\u6703\u7522\u751f\u932f\u8aa4\uff0c<\/span><\/p>\n<p><span style=\"font-size:x-small;\">\u56e0\u6b64\uff0c\u6211\u9084\u662f\u653e\u68c4\u5c0d axd \u6a94\u7684\u58d3\u7e2e\uff0c\u7562\u7adf\u5f88\u5c11\u6709\u89e3\u6c7a\u65b9\u6848\u662f\u80fd\u5920\u767e\u5206\u767e\u6eff\u8db3\u9700\u6c42\u7684\uff0c\u4f9d 80 \/ 20 \u6cd5\u5247\uff0c\u6211\u8a8d\u70ba\u6211\u6240\u4f7f\u7528\u7684 IIS \u555f\u7528 GZIP \u58d3\u7e2e\uff0c<\/span><\/p>\n<p><span style=\"font-size:x-small;\">\u4e26\u642d\u914d ASP.NET AJAX \u7684 ScriptMamager \u3001 ToolkitScriptManager \u7684 ScriptMode \u5c6c\u6027\u8a2d\u5b9a\u70ba Release \u65b9\u6cd5\u5df2\u7d93\u8db3\u5920\uff0c\u6240\u4ee5\uff0c\u5728\u6b64\u5206\u4eab\u7d93\u9a57\u7d66\u5927\u5bb6\u53c3\u8003\u3002<\/span><\/p><\/blockquote>\n<p><span style=\"font-size:x-small;\">Reference from: <\/span>http:\/\/www.dotblogs.com.tw\/jameswu\/archive\/2009\/01\/17\/6846.aspx<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u751f\u5b58\u5728\u8cc7\u8a0a\u7206\u70b8\u7684\u7db2\u9801\u7a0b\u5f0f\u8a2d\u8a08\u5e2b\u5011\u61c9\u8a72\u90fd\u6703\u9047\u5230\u7db2\u7ad9\u6548\u80fd\u4e0d\u4f73\u7684\u554f\u984c\uff0c\u7136\u800c\u7db2\u7ad9\u6548\u80fd\u4e0d\u4f73\u6709\u591a\u7a2e\u539f\u56e0\uff0c\u8209\u51e1 Web Se &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.intentrust.com\/?p=112\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u61c9\u7528 IIS 6.0 \u7684 Gzip \u58d3\u7e2e\u529f\u80fd\u964d\u4f4e\u7db2\u8def\u50b3\u8f38\u91cf\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[78],"_links":{"self":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts\/112"}],"collection":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.intentrust.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}