views:

17

answers:

1

Is it possible to cache the Silverlight application .xap file so that it is not downloaded always?

A: 

Generally this question arises because the server is not configured correctly. Its important to let the client browser cache know how the xap ought to be cached. For example adding the HTTP header:-

Cache-Control: max-age=3600

will let the client know that the xap resource may be cached. Without any indication as to how the server expects client to cache a resource the browser is free to make up its own mind on the matter. Some browsers, like IE, when they see a large resource such as a XAP carriyng no caching instructions simply won't cache at all.

The value of max-age is largely aribitary, you want it long enough to cause the client to think the resource is worth caching but short enough to be reasonably up-to-date.

AnthonyWJones
Thanks a lot Anthony