开发者

Preventing stale xap files from being served by MEF DeploymentCatalogs

开发者 https://www.devze.com 2023-01-09 17:32 出处:网络
In the past I had problems with the browser cache serving older versions of the xap file. In order to overcome this I dynamically add a query string parameter containg the last modified date of the xa

In the past I had problems with the browser cache serving older versions of the xap file. In order to overcome this I dynamically add a query string parameter containg the last modified date of the xap file to the silverlight source parameter in aspx page. This guarentees that开发者_如何学Go clients will receive the latest xap file and not a cached stale versions.

I am now using the DeploymentCatalog functionallity in MEF in a silverlight app to download some xap files. Does anyone know how this works under the hood? Will it use the browser cache or does it download fresh everytime? If it does go through the browser cache, how can I prevent stale cached versions from being served? (as described above).

Thank you!


The DeploymentCatalog just uses the WebClient class to download the xap. Whether it is cached will depend on your browser. From the server-side you should be able to control whether the browser caches the file by using the HTTP Expires header. Here is a question with some information about this: Browser Caching in ASP.NET application

0

精彩评论

暂无评论...
验证码 换一张
取 消