开发者

How to cache xap file while changing query string

开发者 https://www.devze.com 2023-03-11 20:39 出处:网络
I have the same xap loading, but the querystring of the page has been changed:Mypage?querystring=1 ->Mypage?querystring=2

I have the same xap loading, but the querystring of the page has been changed: Mypage?querystring=1 -> Mypage?querystring=2

How can I make it s开发者_开发百科o my xap file always caches?


From a HTTP caching point of view the Url to fetch the HTML of you page is an entirely different resource to the URL to your XAP. Hence there should not be a problem caching the Xap whilst the url to the containing page varies.

You need to ensure you configure the web server to send the appropriate cache control headers when the Xap is fetched. In IIS7 my recommendation would be to set 1 Day expiry on the ClientBin folder.

  • In IIS manager expand the web site and select the ClientBin folder
  • open "HTTP Response Headers" in the main panel
  • select the "Set Common Headers..." action
  • set web content to expire after 1 day

Edit For IIs6:-

  • In IIS manager expand the web site and select the ClientBin folder
  • Right mouse click the ClientBin folder and select Properties
  • Select the HTTP Headers tab
  • Enable Content expiration and accept the 1 day default value
0

精彩评论

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