Night Walker
Night Walker

Reputation: 21260

IIS caching and web services

I am hosting my wcf services with http binding under IIS.

Lately I noticed that there is going on some caching of some sort.

I need to refresh my web service till I am getting the real data, and not that been few minutes ago.

Is there a way to disable this sort of caching ? and how to do so ...

Upvotes: 1

Views: 4280

Answers (1)

Anna Brenden
Anna Brenden

Reputation: 3945

You could add an [AspNetCacheProfile("NoCacheProfile")] attribute to the service method(s) that is defined like this in the web.config for the application (child of the <system.web> element) :

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

This is a .NET Framework 4 feature.

Upvotes: 1

Related Questions