views:

45

answers:

3

Hi All, Im just wondering what would be causing my xap to expire every half day (approx). What i mean is that in the morning a user hits the website and it downloads a copy of the xap, by the afternoon if that user goes back to the website and the website downloads another copy of the xap for them.

I would hope that the only reason that a user should need to download a new copy of the xap would be when they have cleared their browser cache or ive put a new copy up on the server.

Any ideas on what would be the problem and fix?

Thanks

EDIT

I ran fiddler on the XAP download and got the following lines from the cache tab of the xap download entry in fiddler.

HTTP/200 responses are cacheable by default, unless Expires, Pragma, or Cache-Control headers are present and forbid caching.


HTTP/1.1 ETAG Header is present: "2ad1d6bfdd43cb1:0" HTTP Last-Modified Header is present: Tue, 24 Aug 2010 22:43:19 GMT

No Explicit HTTP Expiration information was provided. Most browsers utilize heuristic expiration policies: 10% of the delta between Last-Modified and Date is '02:53:34' so this response will heuristically expire 26/08/2010 4:39:26 PM.


Would this be what the problem is? Where do i set explicit HTTP expiration?

Thanks

+1  A: 

First thing to do is:-

  • install a copy of Fiddler.
  • Drop your temporary internet files.
  • Run Fiddler.
  • Visit your host web page.
  • Find the HTTP session in fiddler that represents the Xap download
  • Add the Raw response headers to your question above.

This will provide a very important set of clues to what the real problem is.

What happens when you refresh? Do you see the second XAP HTTP session return a status 304 response? If you get a 200 add the raw Request headers for this second attempt and its raw response headers to your question.

If you do get a 304, leave it for the appropriate amount of time then try again, is it still give a status 304? If not do the same as above.

This data will give us a lot of info to provide a diagnosis.

AnthonyWJones
A: 

I think what HiTech Magic was hinting at was you need to be able to adjust this setting in IIS. From what Fiddler said it seems like your IIS does not have content expiration set, which I think is the default.

here is how to do it in IIS 6: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true here is how to do it in IIS 7: h'ttp://technet.microsoft.com/en-us/library/cc770661(WS.10).aspx

Alex Lo
A: 

If you're using ASP.Net (can you edit your post to let us know what your backend is?), try using Response.Cache.SetCacheability. There are some gotchas, tho.

cofiem