XAP Caching

Feb 2, 2009 at 3:18 AM
Edited Feb 2, 2009 at 3:19 AM
First of all, thank you for such a great utility.  In my planning for the project I'm currently working on, I was hoping I could find a way to create a loading screen that wouldn't require the use of Silverlight 1.0 and javascript.  I'm glad this is already out here. :)

I have but one question... Does Silverlight Loader handle any type of xap caching?  I have noticed that I see the loading screen every time I refresh the browser.  Is this by design, or is there something I'm missing here.

If this feature isn't already available, how might we go about implementing it?

Thanks,

Joshua Foulk
Coordinator
Feb 2, 2009 at 4:30 PM

Hi Joshua,

I'm glad you find the Silverlight loader project useful.

As for your question, the browser takes care of the caching.

The delay you always experience is probably due to the maxTransferRateKB setting that sets a maximum download speed.

This setting was added in order to make it easier to debug and test loaders, you can set/reset the delay in the code.

This setting can also be useful if you want to force the loader to always run for a minimum amount of time, even if it has already finished loading.

For more info take a look at the excerpt below taken from the Silverlight Loader getting started guide:

PackageDownloadManager  class accepts an optional parameter called maxTransferRateKB that will cause the download rate to be simulated and capped by that amount. This is useful for testing because other wise you will need to delete the cache file after each download and you would also find it hard to debug and test your loader. Setting this parameter to 0 would remove the simulation mode and create a real download experience.

Examples:

// create package download manager and start the download process at max of 100KB per sec

PackageDownloadManager pdm =

new PackageDownloadManager(loader, myDownloadList, 100);

 

// create package download manager and start the download process in real mode -> no cap or simulation

PackageDownloadManager pdm = new PackageDownloadManager(loader, myDownloadList, 0);

-----------------------

-JB