Skip to main content
Avoid incorrect Silverlight XAP file caching
Entry Date: Rate:
Site:
Keywords:
RSS Description:

The code below appends the last-write filedate of the Silverlight Application XAP file to the path in the source parametre of the Silverlight object tag.

This will ensure that poorly constructed caching functionality of webbrowsers and proxy servers doesn’t incorrectly use old builds of the XAP file.

Comments:

Having a proxy cache in your client / company can mean... problems when you deploy a new version of your silverlight app (the old version remains in cache, X hours or even days).

The trick to avoid this is going through the object instantiation and add a parameter to the query string... using that way you can fool the server, you have to decide quite well which param to use, e.g. current date time will force users to download the XAP version every time, there's a better solution in this post get the last write file date of the XAP file.