문제

I have set my compression like this for my NSMutableUrlRequest on my iphone app (I use Monotouch, but it's a 1:1 API match):

var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";  

When I download a resource (REST xml file) and monitor the bandwidth in the iPhoneSimulator, it indicates that the file is being downloaded at its raw file size (20 meg, zipped should be 3 meg-ish).

On my IIS 6 server I have set compression universally. Using a browser to the file works fine with compression when I monitor its bandwidth usage.

Ideas why?

alt text

도움이 되었습니까?

해결책

I think you need to configure IIS to compress XML files as well. More information at http://www.modernsignal.com/settingupgzipcompressioniniis

다른 팁

[req addValue:@"gzip" forHTTPHeaderField:@"Accepts-Encoding"];

Maybe your solution would work like this "Accepts-Encoding"

req["Accepts-Encoding"] = "compress, gzip";  

Additional discussion here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top