2012-06-08 222 views
1

我在IIS下使用http綁定託管我的wcf服務。IIS緩存和Web服務

最近我注意到有某種緩存存在。

我需要刷新我的web服務,直到我得到真實的數據,而不是幾分鐘前。

有沒有辦法禁用這種緩存?如何做到這一點?

回答

1

你可以一個[AspNetCacheProfile("NoCacheProfile")]屬性添加到這樣定義在web.config中的應用程序(<system.web>元素的子級)的服務方法(S):

<caching> 
    <outputCacheSettings> 
    <outputCacheProfiles> 
     <add name="NoCacheProfile" noStore="true" duration="0" varyByParam="none" enabled="true"/> 
    </outputCacheProfiles> 
    </outputCacheSettings> 
</caching> 

這是一個.NET Framework 4 feature