IIS 7.5 웹 서버에서 gzip을 올바르게 설정하면 대부분의 경우 작동합니다.json을 ASP.NET MVC의 JsonResult 액션에서 반환하는 방법은 무엇입니까?
그러나 응답 헤더에서 JsonResult 메소드에 대한 요청이 gzipped되지 않았 음을 알 수 있습니다. JsonResult가 Content-Encoding : gzip으로 데이터를 반환하도록 변경하려면 무엇이 필요합니까?
: 반환 뭔가를 HTML, 예를 들어 RenderPartial()를 호출 헤더의 스크린 샷에을 비교하십시오 JsonResult 메서드를 호출 할 때
이
헤더의 스크린 샷입니다편집 :이 내 압축 설정은 applicationHost.config 파일에서 다음과 같습니다
<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="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" 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>
변경할 경우 = true로 사용할 수는 JSON 압축됩니까에 :
여기에 더 읽기입니까? 이 게시물은 해당 시나리오의 디버깅에 대해 언급합니다 (http://blogs.msdn.com/b/asiatech/archive/2013/02/19/unable-to-compress-json-result-in-iis-7-x.aspx) – Jedidja
applicationHost.config 및 web.config의 url 압축 설정은 무엇입니까? – brucwhi