1

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

Rodney
  • 5,417
  • 7
  • 54
  • 98

2 Answers2

1

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.

Neil
  • 831
  • 9
  • 13
  • Although I have not solved my problem I will award you the bounty for the most conclusive answer - ta – Rodney Sep 18 '12 at 02:31
0

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);
Joseph Mansfield
  • 108,238
  • 20
  • 242
  • 324