tags:

views:

336

answers:

3

When Silverlight downloads the assemblies in your app can it be made to download them as zipped files and then uncompress them before running? This would speed up the download time for a large application.

+1  A: 

Why don't you enable GZIP compression on your server, this should work for silverlight aswell.

Tomh
A xap file is already compressed. It is a zip with a different extension. GZIP compression would probably be slower if it tries to compress an already compressed file.
Jeremy
+5  A: 

afaik silverlight 2 xap files are already zip compressed. So unless I misunderstood you there should not be much optimization through compression. (Edit: See other posts and comments on how to optimize through re-compression. Thanks!)

More Info: Structure of the xap file

What you could do is dynamically load additional assemblies after a small "bootstrap" version of your program distracts the user long enough to load the rest. ;) Dynamically Loading an Assembly

Tobias Hertkorn
One little addition. Visual Studio doesn't currently compress the xap files well. You may want to look into better compression.
BenMaddox
FYI, in Silverlight 3 the XAP files are compressed a little more aggressively than Silverlight 2. You can probably expect them to be 10-20% smaller.
Steve Wortham
+4  A: 

The Silverlight 2 .xap file format is already compressed, if you rename it to .zip you'll be able to open it in Windows Explorer for example.

The default compression is not as optimal as it can be however and so there are a few free utilities you can use to reduce the filesize of the .xap often dramatically.

Here are the best links:

http://web-snippets.blogspot.com/2008/11/another-one-on-repacking-xaps-to-reduce.html

http://blogs.msdn.com/delay/archive/2008/11/04/smaller-is-still-better-a-simple-step-continues-to-shrink-the-download-size-of-silverlight-2-applications.aspx

http://blogs.telerik.com/ValeriHristov/Posts/08-05-13/Increasing_the_compression_ratio_of_the_XAP_files.aspx

Peter McGrattan