How to do I prevent a Silverlight XAP file being cached by the web browser?
The reason I want to do this is during development I don\'t want to manually clear the br
Well all the above examples depend on the browser NOT caching the HTML that contains the new trick xap name.... so you just move the problem on to something else. And they are also fiendishly complicated....
However for the debugging case, at least, it's easy to write the <object> and <param> tags in javascript so that the name changes every time the html page is used, whether it's cached by the browser or not!
<script type="text/javascript">
document.write('<object blah blah >');
document.write('<param name="Source" value="myapp.xap?'
+ new Date().getTime()+'">');
document.write('</object>');
</script>
This sidesteps any hassle you may have controlling server settings and works just as well regardless of the server technology in use.
Note: you have to write the whole object group with the same method because putting a script tag inside the object tag means "only do this if the browser doesnt support the object.