Dealing With Application Load Time
Edit
Problem statement
When a user browses to a page with a large RIA on the page, there is often a significant delay before the application starts up. The reason is that the page itself is fairly light but the package (XAP in the case of Silverlight, SWF in the case of Flex/Flash and so on) that the RIA is in has to finish downloading before the application is able to start. Sometimes these applications are several meg big and that takes a little while to download.
Edit
Default Action
If you don’t do anything, your entire application will download and then start. This is fine for most smaller applications. It is not fine for anything large.
Edit
What you should not do
You should not embed video or any large assets in your package. Those can be loaded on demand after your application loads. Even if your application is just a video player, you should not embed the video because most of the RIA technologies are able to do progressive download playing of videos so they can start the video well before the entire video is downloaded.
Edit
What you should do
There are a couple of methodologies that you can employ here.
The first one is utilizing a zip compression algorithm. You can achieve some significant reductions in package size if you compress it but there's a hit on performance when you are uncompressing the application.
The reality is that you need to think about the architecture of your application and how you can partition your application. The cleaner your architecture the better you will be able to split up your application.
You should partition your application up into a couple of different areas and figure out what the best experience is based on your application.
The partitions are assets, initial functionality, required functionality and optional functionality.
Assets are things like videos, images, music and so on. Anything that’s not used in the initial functionality should be left out of your package and downloaded after the application is loaded.
Initial Functionality is what is the first thing that the user sees. This is important to think about because it’s the first impression of your application. The default here is a large white box in your HTML with some type of load counter. Boring…. The right answer is to either have a splash screen or the absolute minimum required for the user to get started.
The splash screen is simply to entertain the user while your application is being downloaded. The minimum amount of functionality required takes a little bit more thought. One example is loading up the search screen that the user is going to type the search phrase into and downloading the results pane in the background so that it’s ready when the user actually hits the search button.
Edit
Silverlight example
In Silverlight, there magic bit is that you can use the System.AssemblyPart.Load method to dynamically load a separate XAP into your own memory space and access it. There are a couple of different examples of this out there. The easiest to follow is:
Well Performing Silverlight Application with XAML On Demand
by
Ken Casada
Edit
Flex example