One of the overarching goals when designing a Silverlight application is to minimize the size of the XAP file. The smaller the XAP file, the faster the application loads.
In Silverlight 2, one way to prevent external BCL assemblies such as System.Xml.Linq.dll from swelling the XAP file was to delay-load them, as described in this blog post. Silverlight 3 offers a simpler and more elegant option called assembly caching. To demonstrate, here's a XAP file from a project that includes references to System.Xml.Linq.dll and other assemblies that aren't part of the core run-time. The total size of the XAP file was 225K:
To enable assembly caching, I opened the project properties in Visual Studio and checked the "Reduce Xap size" box:
Here's the same XAP file after I rebuilt the project. The new size was only 12K:

How can Silverlight use the external assemblies if they're not packaged in the XAP file? It downloads them from Microsoft's Web site the first time they're needed and caches them locally so they don't have to be downloaded again. Here's the application manifest before the rebuild:
<Deployment xmlns=http://schemas.microsoft.com/client/2007/deployment
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
EntryPointAssembly="RestDemo" EntryPointType="RestDemo.App"
RuntimeVersion="3.0.40307.0">
<Deployment.Parts>
<AssemblyPart x:Name="RestDemo" Source="RestDemo.dll" />
<AssemblyPart x:Name="System.Windows.Controls.Data"
Source="System.Windows.Controls.Data.dll" />
<AssemblyPart x:Name="System.Xml.Linq"
Source="System.Xml.Linq.dll" />
<AssemblyPart x:Name="System.ComponentModel.DataAnnotations"
Source="System.ComponentModel.DataAnnotations.dll" />
<AssemblyPart x:Name="System.ComponentModel"
Source="System.ComponentModel.dll" />
</Deployment.Parts>
</Deployment>
And here's the application manifest after the rebuild:
<Deployment xmlns=http://schemas.microsoft.com/client/2007/deployment
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
EntryPointAssembly="RestDemo" EntryPointType="RestDemo.App"
RuntimeVersion="3.0.40307.0">
<Deployment.Parts>
<AssemblyPart x:Name="RestDemo" Source="RestDemo.dll" />
</Deployment.Parts>
<Deployment.ExternalParts>
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=142572" />
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkId=142576" />
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=142565" />
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=141727" />
</Deployment.ExternalParts>
</Deployment>
Notice the the new <Deployment.ExternalParts>
Silverlight caches the downloaded assemblies in the host operating system's default browser cache. Of course, browsers will cache entire XAP files, too, so even a XAP file that contains embedded assemblies doesn't have to be downloaded every time. One big advantage to assembly caching, however, is that cached assemblies can be shared by all the Silverlight apps on a machine. Once application A has downloaded System.Xml.Linq.dll, for example, application B doesn't have to download it if it, too, is configured to load the assembly from the assembly cache.
On Apr 6 2009 2:37 AMBy jprosise
PingBack from http://www.silverlight-travel.com/blog/2009/04/07/silverlight-3s-new-assembly-caching/
Are the cached assemblies deleted when browser cache is cleared?
how does that work for intranet enviroment, where client machine do not have internet connection to download the assembly from Microsoft website?
Cached assemblies are deleted when the browser cache is cleared, yes. There's no guarantee that cached assemblies will only be downloaded once, but in practice, they shouldn't be downloaded very often.
This is great but isn't a complete solution. We created our own caching solution using the isolated storage the caches the entire XAP file. It is an awesome solution and prevents redownloading xaps that haven't changed
Cool. But caveat: does not work in offline mode. How do I know? Took working offlineable SL app; enabled assembly caching; no dice; disable assembly caching; works once more.
This really isn't a surprise. The offline version wouldn't (shouldn't) have access to the browser cache ... but it is worth noting.
Does this support work for any assembly (including non-MSFT Silverlight assemblies)? Or is it limited to assemblies available from Microsoft?
Transparent Plattform Extensions
Transparent Plattform Extensions
hmm, well I don't see then net gain since the time to download the assemblies and the XAP file = XAP file with included assemblies download time, either case is cached. I do see the if something changes point instead of a re-compile.