Force firefox to get the latest silverlight app

This question was asked before , but 1) the user never accepted the answer 2) none of them stood out better than the others (by vote) and 3) the asker seems to have forgotten about it. So I'm going to ask him again so that I can accept the accepted answer. And some of the users in the thread said that some of the solutions do not work. Sorry for cluttering the place, but I promise to figure it out.

I ran into this problem the other day when I was looking at a Silverlight application in Firefox. I made changes to the location of the image and it did not move. I assumed that I did it wrong, but then I looked at IE7 and the image was in the right place. Turns out Firefox shows a cached version of the file; the changes I made did not show up.

This is a big problem: if I change my application (say, an urgent typo), how can I make the end user see the latest version of my Silverlight application? Is isolated storage (the Heuer blog) really the only way to force updates from the server? Clearing the Firefox cache will not work for a push update; I need the update to be distributed without the end user.

Update: Dino Esposito contains some ideas for managing this, in particular using the Expires property of the Response object. I have not had the opportunity to try this.

+4
source share
2 answers

First, you need to create your application after each layout or code change. Silverlight is not HTML, but code that runs locally.

Secondly, the actual solution to this:

  • page.xaml downloads, starts the asynchronous web service, which is located on the base page
  • webservice discovers Firefox
  • if Firefox, please report the answer that it expires immediately

     [OperationContract] public bool DetectFirefox() { if ((HttpContext.Current.Request.Browser.Browser == "Firefox") && ((HttpContext.Current.Request.Browser.MajorVersion >= 2))) { HttpContext.Current.Response.Expires = -1; } return true; } 

The only caveat here is that you will need to add this code before you want to use it. Otherwise, FF3 will run an old version of your code that has no expiration of the response.

+1
source

Can you encode the version number or timestamp in the file name? Thus, if the page changes, Firefox will notice that it points to a completely different resource and will reload it.

+2
source

All Articles