开发者

Make browser to load silverlight page/xap even when server is offline

Is it possible to force browser to reload a Silverlight application - basically .aspx and .xap files - even if the server goes down? I.e. not accessible to the browser. Like setting caching forever. I tried different cache-control and expires headers but it doesn't seem to make a difference, it's still either 200 or 304 requests.

开发者_如何学JAVA

In other words, I want browser to load .xap once and then never send requests for it again, always loading from cache - never means not even 304s.

In even other words, is it possible to make browsers, once they got page and related content, to use them from cache and not contact server at all?


You use the word "browser" quite a lot but you haven't specified which browser. Most browser have a "work offline" mode in which they will attempt to work without accessing the source server. I'be got a feeling that is not what you are refering to.

My guess though is you are refering to an inability to convince IE not to fetch a resource from the server even though the cache-control header send with it says ought to still be fresh. By default IE does not trust cache content the first time it is accessed during a session.

You can change this behaviour by going into Internet Options and opening the Browsing History Settings. By default the "Check for newer version of pages" is set to "Automatic". Change it "Never". That setting is a bit misleading, what it really means is trust the servers cache headers so don't try to re-fetch a resource which the cache says is still fresh.

Of course there are some serious downsides to this. Its a setting which affects all sites in all zones and its something the user has to do to their client machine.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜