Reputation: 4498
I'm trying to block IE from caching my webpage. After reading some question here I found that there are two solutions:
adding
[OutputCache(Duration = 0)]
to the each controller
or add this to web.config
<caching>
<outputCache enableOutputCache="false" />
</caching>
I decided to go the second way. After putting it to my config file:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off" />
<caching>
<outputCacheSettings enableOutputCache="false" />
</caching>
</system.web>
the enableOutputCache paremeter is underlined with message: "The enableOutputCache parameter is not allowed"
What is wrong with my code?
Upvotes: 0
Views: 381
Reputation: 12491
I think it is syntax error.
This should be:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off" />
<caching>
<outputCache enableOutputCache="false" />
</caching>
</system.web>
If you want to know how to use outputCacheSettings
you can find the answer here.
Upvotes: 1