When working with Silverlight, I\'ve noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to fo
The query string idea doesn't work for me in Silverlight 4. The server seems to cache the darned xap (though not the aspx file). The solution that does work in SL4 is to go to properties on your Silverlight project, go to Assembly info and put in a version.
Simplest way:
<param name="source" value="ClientBin/App.xap?<%= DateTime.Now.Ticks %>" />
This is what I do in php. You read the date/time of the xap file, and append it as a parameter to the download link. In that way the browser sees new file versions as new links, and therefore not in its cache.
<?php $fdate = date("dHis",filemtime("MyApp.xap")) ?>
<param name="source" value="MyApp.xap?=<?php echo $fdate ?>"/>
Simple and it works. Also, browsers continue to cache correctly when there are no updates to download.
We are also in the same situation wherein we want to control when the .XAP file gets downloaded to the browser.
An approach that you might want to take a look at is to use the Silverlight Isolated Storage as a "cache" to store your .XAP files.
Check out this blog: IsolatedStorage as a Silverlight object cache
I had this issue so now when I start a new application I set the assembly version to 0.0.0.1 and just update it by one on every deployment, seems to have solved it for me. Then just set it back to 1.0.0.0 on release.