当前位置:编程学习 > C#/ASP.NET >>

IIS 设置了Gzip后为什么不起作用呢,静态的、非静态的一个都不压缩

根据cnzz介绍的这个方法http://tool.chinaz.com/Gzips/,我设置开启了IIS的Gzip,但为什么不起作用呢,静态的、非静态的一个都不压缩。
http://www.tushuzazhi.com --------------------编程问答-------------------- 没设置正确吧 --------------------编程问答-------------------- 你的服务器的问题。

以下是Fiddler记录的http通讯结果

浏览器下行:
GET http://www.tushuzazhi.com/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://topic.csdn.net/u/20120915/23/f2b18e08-77de-4bcf-8781-98bb4f42899f.html?40837
Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh;q=0.3
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
DNT: 1
Host: www.tushuzazhi.com
Pragma: no-cache
Cookie: __utma=104571781.491281103.1347762713.1347762713.1347762713.1; __utmb=104571781.6.10.1347762713; __utmz=104571781.1347762713.1.1.utmcsr=topic.csdn.net|utmccn=(referral)|utmcmd=referral|utmcct=/u/20120915/23/f2b18e08-77de-4bcf-8781-98bb4f42899f.html; __utmc=104571781; ASP.NET_SessionId=s1rw1uz1msbeuvfmf000yzwq

浏览器下行:
HTTP/1.1 200 OK
Date: Sun, 16 Sep 2012 02:41:18 GMT
Server: Microsoft-IIS/6.0
Cache-Control: private
Content-Type: text/html; charset=gb2312
Content-Length: 51197


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head><title>
图书杂志网 图书信息服务
</title><meta name="description" /><meta name="keywords" /><meta content="text/html; charset=gb2312" http-equiv="Content-Type" /><link rel="Shortcut Icon" href="/images/favicon.ico" /><link href="Styles/Default/css.css" rel="stylesheet" type="text/css" />
    
    <meta name="description" content="图书杂志网,是一个图书、杂志、电子书的信息库。同时还提供各大网上书店最新价格、库存、促销优惠等信息。" />
    <meta name="keywords" content="图书,杂志,比价,电子书,书评,买书" />
    <link href="Styles/Default/CycleAd.css" rel="stylesheet" type="text/css" />
    <link href="Styles/Default/yui/carousel.css" rel="stylesheet" type="text/css" />


    <script type="text/javascript" src="/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-34677664-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

</script>
</head>
<body class="yui-skin-sam">
    <!--Top Begin-->
    <div id="masthead">
        <div id="logo">
            <a href="/">
                <img alt="图书杂志网" src="/images/logo.gif" /></a>
        </div>
        <div id="header">
        </div>
        <div id="search">
            
<form id="formSearch" method="get" action="/search.aspx" onsubmit="return validateSearchTop()">
<select name="category" id="selectSearchCategory"></select>
<input type="text" id="inputSearchKey" name="key" size="14" autocomplete="off" class="searchBox"
    maxlength="70" value="" />
<input type="submit" value="搜索" id="btnSearch" class="searchButton" />
<a href="/AdvanceSearch.aspx">高级搜索</a>
..........................
..........................


当服务器响应上行的
Accept-Encoding: gzip, deflate
时候,它会在下行的消息头中包括
Content-Encoding: gzip
或者
Content-Encoding: deflate
如果没有,说明服务器目前根本不支持压缩。 --------------------编程问答--------------------
引用楼主  的回复:
根据cnzz介绍的这个方法http://tool.chinaz.com/Gzips/,我设置开启了IIS的Gzip,


我不使用iis,不清楚iis如何设置。不过建议你使用iis7以上版本,应该仅仅“打个勾”而已(因为已经内置功能),用不着像这个文章所说的那样麻烦。 --------------------编程问答-------------------- 唉......,郁闷了,搞不定了。过段时间换台32位的Server再试试。 --------------------编程问答-------------------- 除
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,