0

GZIPは、 「text / html」 mimeTypeの80ポートでは機能しませんが、残りのタイプはGZIPで問題なく動作します。だから私はポートを808や他の誰かのような他のものに変えようとしました、すべてが正しくなりました。すべてのmimiTypeには、「text/html」が含まれています。GZIPは問題ありません。


80ポート応答ヘッダー:

text/htmlはgzipできません

Cache-Control:private
Content-Length:2469
Content-Type:text/html; charset=utf-8

text/cssまたはその他のタイプは正常に機能します

Accept-Ranges:bytes
Content-Encoding:gzip
Content-Length:1550
Content-Type:text/css

808ポート応答ヘッダー:

すべてのタイプには、text/html 作業GZIPが含まれています。

Cache-Control:private
Content-Encoding:gzip //became work fine!
Content-Length:1452
Content-Type:text/html; charset=utf-8


Accept-Ranges:bytes
Content-Encoding:gzip // work fine like before
Content-Length:1550
Content-Type:text/css

1.環境:asp.net mvc 2.0 + iis7.5 +windows2008R2。

2. IIS構成:ルートサイト(IISツリーのルートノードを意味します。英語での呼び出し方法がわかりません)とターゲットサイトの両方で、動的コンテンツと静的コンテンツの圧縮をオンにします。

3.ルートサイト:%systemroot%\ System32 \ inetsrv \ config \ applicationHost \ applicationHost.config

    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" doDiskSpaceLimiting="false" minFileSizeForComp="0">
            <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
            <dynamicTypes>
                <add mimeType="text/*" enabled="true" />
                <add mimeType="application/x-javascript" enabled="true" />              
                <add mimeType="message/*" enabled="true" />
                <add mimeType="*/*" enabled="false" />
            </dynamicTypes>
            <staticTypes>
                <add mimeType="text/*" enabled="true" />
                <add mimeType="message/*" enabled="true" />
                <add mimeType="application/x-javascript" enabled="true" />
                <add mimeType="application/atom+xml" enabled="true" />
                <add mimeType="application/xaml+xml" enabled="true" />
                <add mimeType="*/*" enabled="false" />
            </staticTypes>
        </httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />

4.ターゲットサイトのWeb.config:mimeTypeの上でも開きます:

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
  <dynamicTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/x-javascript" enabled="true" />
    <add mimeType="application/json" enabled="true" />
    <add mimeType="application/json; q=0.5" enabled="true" />
    <add mimeType="application/json; charset=utf-8" enabled="true" />
    <add mimeType="application/json; q=0.5; charset=utf-8" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </dynamicTypes>
  <staticTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/x-javascript" enabled="true" />
    <add mimeType="application/atom+xml" enabled="true" />
    <add mimeType="application/xaml+xml" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />

ソリューションリファレンス: asp.netmvc-一部のファイルはgzip圧縮されていません http://www.iis.net/configreference/system.webserver/httpcompression

80ポートのtext/htmlでGZIPを機能させるにはどうすればよいですか?

4

0 に答える 0