Pergunta

I have a Lightswitch OOB 2012 and would like to enable IIS 7 Compression. I followed these steps http://www.hanselman.com/blog/EnablingDynamicCompressionGzipDeflateForWCFDataFeedsODataAndOtherCustomServicesInIIS7.aspx and if I deploy my app in browser then I can see a massive drop in the size when using Fiddler.

However, when I run OOB the responses from the server are not compressed: the SVC requests do not have the Accept-Encoding: GZIP header.

How can I tell the OOB Silverlight requests to use this header in Lightswitch?

Fiddler: No compression: (11 megs for first download)

enter image description here

Fiddler: After compression (running In Browser): enter image description here

Foi útil?

Solução

I believe you are out of luck on this one.

When running in out of browser mode the Silverlight WCF Data Services Client switches to using the Silverlight client HTTP implementation. The Silverlight HTTP client does not support GZIP compression. There is an feature request for this to be changed but given the hazy future of Silverlight I don't think it is likely to happen.

Outras dicas

To support compression for OOB Silverlight Applications, just add the following two lines to your App.xaml.cs(Constructor):

WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.BrowserHttp);
WebRequest.RegisterPrefix("https://", System.Net.Browser.WebRequestCreator.BrowserHttp);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top