Making the Silverlight XAP file expire from browser cache programmatically

AwkwardCoder picture AwkwardCoder · Feb 17, 2010 · Viewed 16.9k times · Source

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 browser cache, I'm looking for a programmatic approach server side.

Answer

AnthonyWJones picture AnthonyWJones · Feb 17, 2010

Using IIS management add a custom header Cache-Control with the value no-cache. That'll cause the browser to check that any cached version of the XAP is the latest before using it.