开发者

Can WCF REST (WebHttpBinding) honor PROGRAMMATIC outputcache policies?

I know all开发者_JAVA百科 about the AspNetCacheProfileAttribute. But is there any way to hook into the cache programmatically? I've tried using Response.Cache in global.asax which seems to set the correct client-side headers but the response is never cached on the server.


I don't think you can do it unless you build your own solution. I just checked implementation of AspNetCahceProfileAttribute which only add internal CachingParameterInspector to the operation dispatcher. This has two problems:

  • Parameter inspector is assigned when the service host starts = during first request and until that it cannot be changed
  • Parameter inspector is initialized in its cosntructor by reading cache configuration from the web.config file based on the profile name passed to AspNetCacheProfileAttribute

There is no API available to modify already assigned and configured parameter inspector

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜