Making the Silverlight XAP file expire from browser cache programmatically

后端 未结 7 981
自闭症患者
自闭症患者 2020-12-05 02:42

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

7条回答
  •  北海茫月
    2020-12-05 03:37

    It’s not very uncommon to run into .XAP caching, which means that every time you deploy a new version of the Silverlight application, the browser does not download the updated .XAP file.

    One solution could be to change the IIS properties. You can turn the “Enable Content Expiration HTTP header” option on for your .XAP file by following these step:

    1. Open IIS Manager
    2. Go to “Default Web Site” and find web site for your Silverlight project.
    3. Find the .XAP file under ClientBin.
    4. Go to the properties page of the .XAP file, on HTTP Headers Tab, Turn on “Enable Content Expiration”, click the “Expire Immediately” radio button.
    5. Save the changes.

    This way the latest .XAP (only if there is a latest .XAP file) will get downloaded when you refresh your page without having to close the browser.

    Hope this helps!

提交回复
热议问题