开发者

Firefox 4 and WCF Data Services etag exceptions

We have several Silverlight 4 apps running using WCF Data Services on our website. Our QA team just installed Firefox 4 and was getting exceptions when the app queries the service, but it works fine in IE 8 and 9, and even Chrome.开发者_C百科

The exception from the service when using FF4 is:"The etag value '""' specified in one of the request headers is not valid. Please make sure only one etag value is specified and is valid."

When browsing to the service in the url, ctrl+F5 works, but just F5 doesn't.

It's a bummer that WCF Data Services doesn't account for this. What is a workaround?


Set the cacheability to NoCache like this:

protected override void OnStartProcessingRequest(ProcessRequestArgs args)
{
    base.OnStartProcessingRequest(args);
    HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
}

jorj

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜