Silverlight 3 assembly caching and Prism Dynamic modules

Topics: Prism v2 - Silverlight 3
Sep 17, 2009 at 8:59 AM

Hi guys,

Is it possible to use Silverlight 3 assembly caching with Prism Dynamic modules in following scenario:

Let's assume that I have dynamic module B, which depends on Silverlight.Windows.Data.Controls.

I want  cached zip package with Silverlight.Windows.Data.Controls to be downloaded only before module B is requested. Is it possible now?


Alexey Zakharov.

Sep 18, 2009 at 10:49 PM

Hi Alexander,

From the Silverlight 3 Assembly Caching documentation: “When a user first visits your Web page, the Silverlight plug-in downloads the application package and all required external parts. These files are added to the browser cache so that they can be reused on subsequent visits.” If you want to load a particular assembly just when ModuleB is loaded on demand, you simply have to remove any reference you have to that assembly in the Shell project and only keep it in ModuleB. Take into account that if other modules use this assembly, you would be duplicating the size it occupies whereas having it in the Shell avoids this.

It might still be a good idea to make the Silverlight.Windows.Data.Controls assembly and similar ones to be downloaded with Silverlight 3 cache. As those libraries will rarely change (opposed to those on your production code), end users will take less time downloading the application, as some of the assemblies it requires will be cached on their browser (more on the SL3 documentation article above).

Please let me know if this helps.

Damian Schenkelman