Search code examples
asp.netweb-configoutput-caching

Unable to set outputCacheSettings in WebConfig file


I am Trying to implement outputcaching in my website When I try to add

    <outputCacheSettings>
    <outputCacheProfiles>
        <add name="TwoDay" duration="43200" />
    </outputCacheProfiles>
</outputCacheSettings>

This to my webconfig file it throws an error

    The configuration section 'outputCacheSettings' cannot be read because it is missing a section declaration

I have added above code inside

<configuration>

section in webconfig. Can any one tell me what I am doing wrong?


Solution

  • Put it in the <caching> section in the <system.web> section as explained here on MSDN.